com.sun.enterprise.v3.services.impl
Class GrizzlyProxy

java.lang.Object
  extended by 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
static String AUTO_CONFIGURE
           
protected  org.glassfish.grizzly.config.GrizzlyListener grizzlyListener
           
static String LEADER_FOLLOWER
           
 
Constructor Summary
GrizzlyProxy(GrizzlyService service, org.glassfish.grizzly.config.dom.NetworkListener listener)
           
 
Method Summary
protected  void createGlassfishListener()
           
protected  void createGrizzlyListener(org.glassfish.grizzly.config.dom.NetworkListener networkListener)
           
protected  void createServiceInitializerListener()
           
 void destroy()
          Destroy the proxy.
 InetAddress getAddress()
           
 int getPort()
           
 org.glassfish.grizzly.config.GrizzlyListener getUnderlyingListener()
           
 void initialize()
          Create a GrizzlyServiceListener based on a NetworkListener configuration object.
 void registerEndpoint(Endpoint endpoint)
          Registers a new endpoint (proxy implementation) defined by the passed Endpoint object.
 void registerEndpoint(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.
 void stop()
          Stops the Grizzly service.
 String toString()
           
 void unregisterEndpoint(Endpoint endpoint)
          Removes the Endpoint from our list of endpoints.
 void unregisterEndpoint(String contextRoot, ApplicationContainer app)
          Removes the context-root from our list of endpoints.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

grizzlyListener

protected org.glassfish.grizzly.config.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,
                    org.glassfish.grizzly.config.dom.NetworkListener listener)
Method Detail

initialize

public void initialize()
                throws IOException
Create a GrizzlyServiceListener based on a NetworkListener configuration object.

Throws:
IOException

createGrizzlyListener

protected void createGrizzlyListener(org.glassfish.grizzly.config.dom.NetworkListener networkListener)

createGlassfishListener

protected void createGlassfishListener()

createServiceInitializerListener

protected void createServiceInitializerListener()

stop

public void stop()
          throws IOException
Stops the Grizzly service.

Specified by:
stop in interface NetworkProxy
Throws:
IOException

destroy

public void destroy()
Description copied from interface: NetworkProxy
Destroy the proxy.

Specified by:
destroy in interface NetworkProxy

toString

public String toString()
Overrides:
toString in class Object

registerEndpoint

public void registerEndpoint(String contextRoot,
                             Collection<String> vsServers,
                             org.glassfish.grizzly.http.server.HttpHandler endpointService,
                             ApplicationContainer container)
                      throws EndpointRegistrationException
Description copied from interface: EndpointMapper
Registers 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:
registerEndpoint in interface EndpointMapper<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:
unregisterEndpoint in interface EndpointMapper<org.glassfish.grizzly.http.server.HttpHandler>
Throws:
EndpointRegistrationException

registerEndpoint

public void registerEndpoint(Endpoint endpoint)
Registers a new endpoint (proxy implementation) defined by the passed Endpoint object.

Specified by:
registerEndpoint in interface EndpointMapper<org.glassfish.grizzly.http.server.HttpHandler>
Parameters:
endpoint - Endpoint

unregisterEndpoint

public void unregisterEndpoint(Endpoint endpoint)
                        throws EndpointRegistrationException
Removes the Endpoint from our list of endpoints.

Specified by:
unregisterEndpoint in interface EndpointMapper<org.glassfish.grizzly.http.server.HttpHandler>
Parameters:
endpoint - Endpoint
Throws:
EndpointRegistrationException

start

public Future<Result<Thread>> start()
                             throws IOException
Description copied from interface: NetworkProxy
Start the proxy.

Specified by:
start in interface NetworkProxy
Throws:
IOException

getPort

public int getPort()
Specified by:
getPort in interface NetworkProxy
Returns:
the network port upon which this NetworkProxy is listening on

getAddress

public InetAddress getAddress()
Specified by:
getAddress in interface NetworkProxy
Returns:
the InetAddress of this NetworkProxy

getUnderlyingListener

public org.glassfish.grizzly.config.GrizzlyListener getUnderlyingListener()


Copyright © 2012. All Rights Reserved.