InfoRefsServlet to catch smart service requests.
| Modifier and Type | Class and Description |
|---|---|
| private class |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| protected abstract void | advertise(HttpServletRequest
request req, RefAdvertiser.used to frame lines in PacketLineOut format pckAdvertise. |
| protected abstract void | |
| public void | destroy()
Overrides default jakarta. Called by the web container to indicate to a filter that it is being taken out of service. |
| public void | doFilter(ServletRequest
the request, ServletResponse ServletRequest object contains the client's requestthe response, FilterChain ServletResponse object contains the filter's responsethe chain)FilterChain for invoking the next filter or the resourceImplements jakarta. The |
| public void | init(FilterConfig
a config)FilterConfig object containing the filter's configuration and initialization
parametersOverrides default jakarta. Called by the web container to indicate to a filter that it is being placed into service. |
| protected void | respond(HttpServletRequest
request req, PacketLineOut destination of response pckOut, String service name to be written out in protocol v0; may or may not
be used in other versions serviceName)Writes the appropriate response to an info/refs request received by a smart service. |
| private void |
| filters | back to summary |
|---|---|
| private final Filter[] filters | |
| svc | back to summary |
|---|---|
| private final String svc | |
| SmartServiceInfoRefs | back to summary |
|---|---|
| pack-priv SmartServiceInfoRefs(String service, List<Filter> filters) | |
| advertise | back to summary |
|---|---|
| protected abstract void advertise(HttpServletRequest req, RefAdvertiser. Advertise.
| |
| begin | back to summary |
|---|---|
| protected abstract void begin(HttpServletRequest req, Repository db) throws IOException, ServiceNotEnabledException, ServiceNotAuthorizedException Begin service.
| |
| destroy | back to summary |
|---|---|
| public void destroy() Overrides default jakarta. Doc from jakarta. Called by the web container to indicate to a filter that it is being taken out of service. This method is only called once all threads within the filter's doFilter method have exited or after a timeout period has passed. After the web container calls this method, it will not call the doFilter method again on this instance of the filter. This method gives the filter an opportunity to clean up any resources that are being held (for example, memory, file handles, threads) and make sure that any persistent state is synchronized with the filter's current state in memory.
| |
| doFilter | back to summary |
|---|---|
| public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException Implements jakarta. Doc from jakarta. The A typical implementation of this method would follow the following pattern:
| |
| init | back to summary |
|---|---|
| public void init(FilterConfig config) throws ServletException Overrides default jakarta. Doc from jakarta. Called by the web container to indicate to a filter that it is being placed into service.
The servlet container calls the init method exactly once after instantiating the filter. The init method must
complete successfully before the filter is asked to do any filtering work. The container will ensure that actions
performed in the The web container cannot place the filter into service if the init method either
| |
| respond | back to summary |
|---|---|
| protected void respond(HttpServletRequest req, PacketLineOut pckOut, String serviceName) throws IOException, ServiceNotEnabledException, ServiceNotAuthorizedException Writes the appropriate response to an info/refs request received by a smart service. In protocol v0, this starts with "# service=serviceName" followed by a flush packet, but this is not necessarily the case in other protocol versions.
The default implementation writes "# service=serviceName" and a flush
packet, then calls
| |
| service | back to summary |
|---|---|
| private void service(ServletRequest request, ServletResponse response) throws IOException | |
| Modifier and Type | Field and Description |
|---|---|
| private int |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | doFilter(ServletRequest
the request to pass along the chain. req, ServletResponse the response to pass along the chain. rsp)Implements jakarta. Causes the next filter in the chain to be invoked, or if the calling filter is the last filter in the chain, causes the resource at the end of the chain to be invoked. |
| filterIdx | back to summary |
|---|---|
| private int filterIdx | |
| Chain | back to summary |
|---|---|
| private Chain() | |
| doFilter | back to summary |
|---|---|
| public void doFilter(ServletRequest req, ServletResponse rsp) throws IOException, ServletException Implements jakarta. Doc from jakarta. Causes the next filter in the chain to be invoked, or if the calling filter is the last filter in the chain, causes the resource at the end of the chain to be invoked.
| |