@Service @RunLevel(value=10) @Rank(value=50) public class GrizzlyService extends Object implements RequestDispatcher, org.glassfish.hk2.api.PostConstruct, org.glassfish.hk2.api.PreDestroy, EventListener, FutureProvider<Result<Thread>>
| Modifier and Type | Class and Description |
|---|---|
static class |
GrizzlyService.NoopInvocationHandler
Probe provider that implements each probe provider method as a
no-op.
|
EventListener.Event<T>| Constructor and Description |
|---|
GrizzlyService() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addMapperUpdateListener(MapperUpdateListener listener)
Adds
MapperUpdateListener to listeners queue. |
void |
addNetworkProxy(NetworkProxy proxy)
Add the new proxy to our list of proxies.
|
boolean |
closeNetworkProxy(NetworkProxy proxy) |
Future<Result<Thread>> |
createNetworkProxy(NetworkListener listener) |
void |
event(EventListener.Event event)
Method is invoked each time Glassfish state changes.
|
List<Future<Result<Thread>>> |
getFutures() |
org.glassfish.hk2.api.ServiceLocator |
getHabitat()
Gets the habitat.
|
Logger |
getLogger()
Gets the logger.
|
GrizzlyMonitoring |
getMonitoring() |
int |
getRealPort(NetworkListener listener) |
boolean |
hasMapperUpdateListener()
Is there any
MapperUpdateListener registered? |
NetworkProxy |
lookupNetworkProxy(NetworkListener listener)
Lookup
GrizzlyProxy, which corresponds to the NetworkListener. |
void |
notifyMapperUpdateListeners(NetworkListener networkListener,
org.glassfish.grizzly.http.server.util.Mapper mapper)
Notify all
MapperUpdateListeners about update happened. |
ReentrantReadWriteLock |
obtainMapperLock()
Returns HTTP
Mapper lock to prevent concurrent access to a
Mapper object. |
void |
postConstruct()
The component has been injected with any dependency and
will be placed into commission by the subsystem.
|
void |
preDestroy()
The component is about to be removed from commission
|
void |
registerEndpoint(Endpoint endpoint)
Registers a new endpoint for the given context root at the given port
number.
|
void |
registerEndpoint(String contextRoot,
Collection<String> vsServers,
org.glassfish.grizzly.http.server.HttpHandler endpointAdapter,
ApplicationContainer container)
Registers a new endpoint (proxy implementation) for a particular context-root.
|
void |
registerEndpoint(String contextRoot,
org.glassfish.grizzly.http.server.HttpHandler endpointAdapter,
ApplicationContainer container)
Registers a new endpoint (proxy implementation) for a particular context-root.
|
void |
registerEndpoint(String contextRoot,
org.glassfish.grizzly.http.server.HttpHandler endpointAdapter,
ApplicationContainer container,
String virtualServers)
Registers a new endpoint (proxy implementation) for a particular context-root.
|
void |
registerEndpoint(String contextRoot,
InetAddress address,
int port,
Collection<String> vsServers,
org.glassfish.grizzly.http.server.HttpHandler endpointAdapter,
ApplicationContainer container)
Registers a new endpoint for the given context root at the given port
number.
|
protected void |
registerMonitoringStatsProviders() |
boolean |
removeMapperUpdateListener(MapperUpdateListener listener)
Removes
MapperUpdateListener to listeners queue. |
boolean |
removeNetworkProxy(NetworkListener listener)
Remove the proxy from our list of proxies by listener.
|
boolean |
removeNetworkProxy(NetworkProxy proxy)
Remove the proxy from our list of proxies.
|
boolean |
removeNetworkProxy(String id)
Remove the proxy from our list of proxies by id.
|
void |
restartNetworkListener(NetworkListener networkListener,
long timeout,
TimeUnit timeUnit)
Restart
NetworkListener. |
void |
restartNetworkListener(String networkListenerName,
long timeout,
TimeUnit timeUnit)
Restart
NetworkListener. |
void |
unregisterEndpoint(String contextRoot)
Removes the context-root from our list of endpoints.
|
void |
unregisterEndpoint(String contextRoot,
ApplicationContainer app)
Removes the context-root from our list of endpoints.
|
protected void |
unregisterMonitoringStatsProviders() |
public void addNetworkProxy(NetworkProxy proxy)
proxy - new proxy to be addedpublic boolean removeNetworkProxy(NetworkListener listener)
listener - removes the proxy associated with the specified listenerpublic boolean removeNetworkProxy(String id)
public boolean closeNetworkProxy(NetworkProxy proxy)
public boolean removeNetworkProxy(NetworkProxy proxy)
public NetworkProxy lookupNetworkProxy(NetworkListener listener)
GrizzlyProxy, which corresponds to the NetworkListener.listener - NetworkListener.GrizzlyProxy, or null, if correspondent GrizzlyProxy wasn't found.public void restartNetworkListener(String networkListenerName, long timeout, TimeUnit timeUnit) throws IOException, TimeoutException
NetworkListener.networkListenerName - timeout - restart timeout, if timeout value is negative - then no timeout will be applied.timeUnit - restart timeout unitTimeoutException - thrown if timeout had expired before server succeeded to restartIOExceptionpublic void restartNetworkListener(NetworkListener networkListener, long timeout, TimeUnit timeUnit) throws IOException, TimeoutException
NetworkListener.networkListener - NetworkListenertimeout - restart timeout, if timeout value is negative - then no timeout will be applied.timeUnit - restart timeout unitTimeoutException - thrown if timeout had expired before server succeeded to restartIOExceptionpublic boolean hasMapperUpdateListener()
MapperUpdateListener registered?public boolean addMapperUpdateListener(MapperUpdateListener listener)
MapperUpdateListener to listeners queue.listener - the listener to be added.public boolean removeMapperUpdateListener(MapperUpdateListener listener)
MapperUpdateListener to listeners queue.listener - the listener to be removed.public void notifyMapperUpdateListeners(NetworkListener networkListener, org.glassfish.grizzly.http.server.util.Mapper mapper)
MapperUpdateListeners about update happened.networkListener - NetworkListener, which Mapper got changedmapper - new Mapper valuepublic ReentrantReadWriteLock obtainMapperLock()
Mapper lock to prevent concurrent access to a
Mapper object.public Logger getLogger()
public org.glassfish.hk2.api.ServiceLocator getHabitat()
public GrizzlyMonitoring getMonitoring()
public void event(EventListener.Event event)
event in interface EventListenerpublic void postConstruct()
postConstruct in interface org.glassfish.hk2.api.PostConstructpublic int getRealPort(NetworkListener listener)
public List<Future<Result<Thread>>> getFutures()
getFutures in interface FutureProvider<Result<Thread>>public Future<Result<Thread>> createNetworkProxy(NetworkListener listener)
public void preDestroy()
preDestroy in interface org.glassfish.hk2.api.PreDestroypublic void registerEndpoint(String contextRoot, org.glassfish.grizzly.http.server.HttpHandler endpointAdapter, ApplicationContainer container) throws EndpointRegistrationException
RequestDispatcherregisterEndpoint in interface RequestDispatchercontextRoot - for the proxyendpointAdapter - servicing requests.EndpointRegistrationExceptionpublic void registerEndpoint(String contextRoot, org.glassfish.grizzly.http.server.HttpHandler endpointAdapter, ApplicationContainer container, String virtualServers) throws EndpointRegistrationException
RequestDispatcherregisterEndpoint in interface RequestDispatchercontextRoot - for the proxyendpointAdapter - servicing requests.virtualServers - comma separated list of the virtual serversEndpointRegistrationExceptionpublic void registerEndpoint(String contextRoot, Collection<String> vsServers, org.glassfish.grizzly.http.server.HttpHandler endpointAdapter, ApplicationContainer container) throws EndpointRegistrationException
RequestDispatcherregisterEndpoint in interface RequestDispatchercontextRoot - for the proxyendpointAdapter - servicing requests.EndpointRegistrationExceptionpublic void registerEndpoint(String contextRoot, InetAddress address, int port, Collection<String> vsServers, org.glassfish.grizzly.http.server.HttpHandler endpointAdapter, ApplicationContainer container) throws EndpointRegistrationException
registerEndpoint in interface RequestDispatcherEndpointRegistrationExceptionpublic void registerEndpoint(Endpoint endpoint) throws EndpointRegistrationException
EndpointRegistrationExceptionpublic void unregisterEndpoint(String contextRoot) throws EndpointRegistrationException
unregisterEndpoint in interface RequestDispatcherEndpointRegistrationExceptionpublic void unregisterEndpoint(String contextRoot, ApplicationContainer app) throws EndpointRegistrationException
unregisterEndpoint in interface RequestDispatcherEndpointRegistrationExceptionprotected void registerMonitoringStatsProviders()
protected void unregisterMonitoringStatsProviders()
Copyright © 2019. All rights reserved.