net.sf.j2ep.model
Interface ServerContainer

All Known Implementing Classes:
BaseServer, ClusterContainer, RoundRobinCluster, ServerContainerBase

public interface ServerContainer

A server container is a object can can hold a server. It is used to do initial processing of the data in a request before a server is created. This can be used to make some decisions on the server creating based on the request to allow more advanced server. Usually the server can implement both this interface and the server interface since the usage is rather linked.

Author:
Anders Nyman

Method Summary
 Rule getRule()
          Returns the mapped rule.
 Server getServer(HttpServletRequest request)
          Do any processing needed before this server can be used.
 Server getServerMapped(java.lang.String link)
          Finds a server with the full path specified by the location sent in.
 void setRule(Rule rule)
          Sets the rule that is mapped for this server.
 

Method Detail

getServer

Server getServer(HttpServletRequest request)
Do any processing needed before this server can be used. Specifically important for cluster servers that needs to choose which server to use for the current request.

Returns:
The server that is finished to be used.

getRule

Rule getRule()
Returns the mapped rule. This method must return the same rule as a call to the underlying servers getRule().

Returns:
The rule we are mapped to
See Also:
Server.getRule()

setRule

void setRule(Rule rule)
Sets the rule that is mapped for this server. Will be used when we rewrite links to know how a absolute path should be rewritten.

Parameters:
rule - The rule

getServerMapped

Server getServerMapped(java.lang.String link)
Finds a server with the full path specified by the location sent in.

Parameters:
link - The start of a link that a server is mapped to
Returns:
The server that can handle the link, null if no server is found