Class GrizzlyProxy
- java.lang.Object
-
- com.sun.enterprise.v3.services.impl.GrizzlyProxy
-
- All Implemented Interfaces:
EndpointMapper<org.glassfish.grizzly.http.server.HttpHandler>,NetworkProxy
public class GrizzlyProxy extends Object implements NetworkProxy
This class is responsible for configuring Grizzly.- Author:
- Jerome Dochez, Jeanfrancois Arcand
-
-
Field Summary
Fields Modifier and Type Field Description static StringAUTO_CONFIGUREprotected GrizzlyListenergrizzlyListenerstatic StringLEADER_FOLLOWER
-
Constructor Summary
Constructors Constructor Description GrizzlyProxy(GrizzlyService service, NetworkListener listener)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected GrizzlyListenercreateGlassfishListener(NetworkListener networkListener)protected GrizzlyListenercreateGrizzlyListener(NetworkListener networkListener)protected GrizzlyListenercreateServiceInitializerListener(NetworkListener networkListener)voiddestroy()Destroy the proxy.InetAddressgetAddress()intgetPort()GrizzlyListenergetUnderlyingListener()voidinitialize()Create aGrizzlyServiceListenerbased on a NetworkListener configuration object.voidregisterEndpoint(Endpoint endpoint)Registers a new endpoint (proxy implementation) defined by the passedEndpointobject.voidregisterEndpoint(String contextRoot, Collection<String> vsServers, org.glassfish.grizzly.http.server.HttpHandler endpointService, ApplicationContainer container)Registers a new endpoint (proxy implementation) for a particular context-root.Future<Result<Thread>>start()Start the proxy.protected voidstart0()Start internal Grizzly listener.voidstop()Stops the Grizzly service.StringtoString()voidunregisterEndpoint(Endpoint endpoint)Removes theEndpointfrom our list of endpoints.voidunregisterEndpoint(String contextRoot, ApplicationContainer app)Removes the context-root from our list of endpoints.
-
-
-
Field Detail
-
grizzlyListener
protected GrizzlyListener grizzlyListener
-
LEADER_FOLLOWER
public static final String LEADER_FOLLOWER
- See Also:
- Constant Field Values
-
AUTO_CONFIGURE
public static final String AUTO_CONFIGURE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GrizzlyProxy
public GrizzlyProxy(GrizzlyService service, NetworkListener listener)
-
-
Method Detail
-
initialize
public void initialize() throws IOExceptionCreate aGrizzlyServiceListenerbased on a NetworkListener configuration object.- Throws:
IOException
-
createGrizzlyListener
protected GrizzlyListener createGrizzlyListener(NetworkListener networkListener)
-
createGlassfishListener
protected GrizzlyListener createGlassfishListener(NetworkListener networkListener)
-
createServiceInitializerListener
protected GrizzlyListener createServiceInitializerListener(NetworkListener networkListener)
-
stop
public void stop() throws IOExceptionStops the Grizzly service.- Specified by:
stopin interfaceNetworkProxy- Throws:
IOException
-
destroy
public void destroy()
Description copied from interface:NetworkProxyDestroy the proxy.- Specified by:
destroyin interfaceNetworkProxy
-
registerEndpoint
public void registerEndpoint(String contextRoot, Collection<String> vsServers, org.glassfish.grizzly.http.server.HttpHandler endpointService, ApplicationContainer container) throws EndpointRegistrationException
Description copied from interface:EndpointMapperRegisters a new endpoint (proxy implementation) for a particular context-root. All request coming with the context root will be dispatched to the proxy instance passed in.- Specified by:
registerEndpointin interfaceEndpointMapper<org.glassfish.grizzly.http.server.HttpHandler>- Parameters:
contextRoot- for the proxy- Throws:
EndpointRegistrationException
-
unregisterEndpoint
public void unregisterEndpoint(String contextRoot, ApplicationContainer app) throws EndpointRegistrationException
Removes the context-root from our list of endpoints.- Specified by:
unregisterEndpointin interfaceEndpointMapper<org.glassfish.grizzly.http.server.HttpHandler>- Throws:
EndpointRegistrationException
-
registerEndpoint
public void registerEndpoint(Endpoint endpoint)
Registers a new endpoint (proxy implementation) defined by the passedEndpointobject.- Specified by:
registerEndpointin interfaceEndpointMapper<org.glassfish.grizzly.http.server.HttpHandler>- Parameters:
endpoint-Endpoint
-
unregisterEndpoint
public void unregisterEndpoint(Endpoint endpoint) throws EndpointRegistrationException
Removes theEndpointfrom our list of endpoints.- Specified by:
unregisterEndpointin interfaceEndpointMapper<org.glassfish.grizzly.http.server.HttpHandler>- Parameters:
endpoint-Endpoint- Throws:
EndpointRegistrationException
-
start
public Future<Result<Thread>> start() throws IOException
Description copied from interface:NetworkProxyStart the proxy.- Specified by:
startin interfaceNetworkProxy- Throws:
IOException
-
start0
protected void start0() throws IOExceptionStart internal Grizzly listener.- Throws:
IOException
-
getPort
public int getPort()
- Specified by:
getPortin interfaceNetworkProxy- Returns:
- the network port upon which this
NetworkProxyis listening on
-
getAddress
public InetAddress getAddress()
- Specified by:
getAddressin interfaceNetworkProxy- Returns:
- the
InetAddressof thisNetworkProxy
-
getUnderlyingListener
public GrizzlyListener getUnderlyingListener()
-
-