Package org.infinispan.server.core
Class AbstractProtocolServer<A extends ProtocolServerConfiguration>
- java.lang.Object
-
- org.infinispan.server.core.AbstractProtocolServer<A>
-
- All Implemented Interfaces:
ProtocolServer<A>
- Direct Known Subclasses:
HotRodServer
,MemcachedServer
,RestServer
public abstract class AbstractProtocolServer<A extends ProtocolServerConfiguration> extends java.lang.Object implements ProtocolServer<A>
A common protocol server dealing with common property parameter validation and assignment and transport lifecycle.- Since:
- 4.1
- Author:
- Galder ZamarreƱo, wburns
-
-
Field Summary
Fields Modifier and Type Field Description protected EmbeddedCacheManager
cacheManager
protected A
configuration
protected NettyTransport
transport
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractProtocolServer(java.lang.String protocolName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
defaultCacheName()
CacheIgnoreManager
getCacheIgnore()
EmbeddedCacheManager
getCacheManager()
A
getConfiguration()
Returns the configuration used to start this serverjava.util.concurrent.ThreadPoolExecutor
getExecutor()
java.lang.String
getHost()
java.lang.String
getName()
Returns the name of this serverjava.lang.Integer
getPort()
java.lang.String
getQualifiedName()
NettyTransport
getTransport()
protected boolean
isCacheIgnored(java.lang.String cache)
boolean
isTransportEnabled()
protected void
registerServerMBeans()
void
start(A configuration, EmbeddedCacheManager cacheManager)
Starts the server backed by the given cache manager and with the corresponding configuration.void
start(A configuration, EmbeddedCacheManager cacheManager, CacheIgnoreManager cacheIgnore)
Starts the server backed by the given cache manager, with the corresponding configuration and the handler for the ignored caches stateprotected void
startDefaultCache()
protected void
startInternal(A configuration, EmbeddedCacheManager cacheManager)
protected void
startTransport()
void
stop()
Stops the serverprotected void
unregisterServerMBeans()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.infinispan.server.core.ProtocolServer
getDecoder, getEncoder, getInitializer
-
-
-
-
Field Detail
-
transport
protected NettyTransport transport
-
cacheManager
protected EmbeddedCacheManager cacheManager
-
configuration
protected A extends ProtocolServerConfiguration configuration
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from interface:ProtocolServer
Returns the name of this server- Specified by:
getName
in interfaceProtocolServer<A extends ProtocolServerConfiguration>
-
startInternal
protected void startInternal(A configuration, EmbeddedCacheManager cacheManager)
-
isCacheIgnored
protected boolean isCacheIgnored(java.lang.String cache)
-
getCacheIgnore
public CacheIgnoreManager getCacheIgnore()
-
start
public final void start(A configuration, EmbeddedCacheManager cacheManager)
Description copied from interface:ProtocolServer
Starts the server backed by the given cache manager and with the corresponding configuration.- Specified by:
start
in interfaceProtocolServer<A extends ProtocolServerConfiguration>
-
start
public void start(A configuration, EmbeddedCacheManager cacheManager, CacheIgnoreManager cacheIgnore)
Description copied from interface:ProtocolServer
Starts the server backed by the given cache manager, with the corresponding configuration and the handler for the ignored caches state- Specified by:
start
in interfaceProtocolServer<A extends ProtocolServerConfiguration>
-
startTransport
protected void startTransport()
-
getExecutor
public java.util.concurrent.ThreadPoolExecutor getExecutor()
-
registerServerMBeans
protected void registerServerMBeans()
-
unregisterServerMBeans
protected void unregisterServerMBeans() throws java.lang.Exception
- Throws:
java.lang.Exception
-
getQualifiedName
public final java.lang.String getQualifiedName()
-
stop
public void stop()
Description copied from interface:ProtocolServer
Stops the server- Specified by:
stop
in interfaceProtocolServer<A extends ProtocolServerConfiguration>
-
getCacheManager
public EmbeddedCacheManager getCacheManager()
-
getHost
public java.lang.String getHost()
-
getPort
public java.lang.Integer getPort()
-
getConfiguration
public A getConfiguration()
Description copied from interface:ProtocolServer
Returns the configuration used to start this server- Specified by:
getConfiguration
in interfaceProtocolServer<A extends ProtocolServerConfiguration>
-
startDefaultCache
protected void startDefaultCache()
-
defaultCacheName
public java.lang.String defaultCacheName()
-
isTransportEnabled
public boolean isTransportEnabled()
-
getTransport
public NettyTransport getTransport()
-
-