public abstract class AbstractChannelFactory extends java.lang.Object implements ChannelFactory
| Modifier and Type | Field and Description |
|---|---|
protected AliasRegistry |
aliasRegistry |
protected ContentType |
contentType |
protected java.lang.Object |
context |
protected ChannelBuilder |
defaultChannelBuilder |
protected java.lang.Long |
defaultTimeToLive |
protected Transport |
messagingTransport |
protected java.util.Map<java.lang.String,Transport> |
messagingTransports |
protected Transport |
remotingTransport |
protected java.util.Set<java.lang.String> |
scanPackageNames |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractChannelFactory(ContentType contentType) |
protected |
AbstractChannelFactory(ContentType contentType,
java.lang.Object context) |
protected |
AbstractChannelFactory(ContentType contentType,
java.lang.Object context,
Transport remotingTransport,
Transport messagingTransport) |
| Modifier and Type | Method and Description |
|---|---|
ContentType |
getContentType()
The encoding (AMF or JMF) for this ChannelFactory
|
java.lang.Object |
getContext()
A generic context object used to create transports (actual type of the context depends on the
Platform) |
java.lang.String |
getDefaultChannelType()
Return the default type of messaging channels (initially ChannelType.LONG_POLLING)
|
long |
getDefaultTimeToLive()
The default time to live defined for channels created by this factory
|
Transport |
getMessagingTransport()
The default transport for messaging channels
|
Transport |
getMessagingTransport(java.lang.String channelType)
The transport for the specified messaging channel type
|
java.util.Map<java.lang.String,Transport> |
getMessagingTransports()
The transports for messaging channels
|
protected abstract java.lang.Class<? extends RemotingChannel> |
getRemotingChannelClass() |
Transport |
getRemotingTransport()
The transport for remoting channels
|
MessagingChannel |
newMessagingChannel(java.lang.String id,
ServerApp serverApp)
Create a messaging channel of the default type using the specified server application definition
|
MessagingChannel |
newMessagingChannel(java.lang.String id,
java.lang.String uri)
Create a messaging channel of the default type using the specified uri
|
MessagingChannel |
newMessagingChannel(java.lang.String channelType,
java.lang.String id,
ServerApp serverApp)
Create a messaging channel of the specified type using the specified server application definition
|
MessagingChannel |
newMessagingChannel(java.lang.String channelType,
java.lang.String id,
java.lang.String uri)
Create a messaging channel of the specified type using the specified uri
|
MessagingChannel |
newMessagingChannel(java.lang.String channelType,
java.lang.String id,
java.net.URI uri)
Create a messaging channel of the specified type using the specified
URI |
MessagingChannel |
newMessagingChannel(java.lang.String id,
java.net.URI uri)
Create a messaging channel of the default type using the specified
URI |
protected abstract <M> MessagingCodec<M> |
newMessagingCodec(java.lang.Class<M> messageClass) |
RemotingChannel |
newRemotingChannel(java.lang.String id,
ServerApp serverApp)
Create a remoting channel using the specified server application definition
|
RemotingChannel |
newRemotingChannel(java.lang.String id,
ServerApp serverApp,
int maxConcurrentRequests)
Create a remoting channel using the specified server application definition
|
RemotingChannel |
newRemotingChannel(java.lang.String id,
java.lang.String uri)
Create a remoting channel using the specified uri
|
RemotingChannel |
newRemotingChannel(java.lang.String id,
java.lang.String uri,
int maxConcurrentRequests)
Create a remoting channel using the specified uri
|
RemotingChannel |
newRemotingChannel(java.lang.String id,
java.net.URI uri)
Create a remoting channel using the specified
URI |
RemotingChannel |
newRemotingChannel(java.lang.String id,
java.net.URI uri,
int maxConcurrentRequests)
Create a remoting channel using the specified
URI |
void |
setAliasRegistry(AliasRegistry aliasRegistry)
The alias registry for this factory
|
void |
setContext(java.lang.Object context)
Set the current context used to create transports (actual type of this context depends on the
Platform) |
void |
setDefaultChannelBuilder(ChannelBuilder channelBuilder)
Set the default builder for channels
A custom channel builder can also be defined to change the default url mappings of the remoting and messaging channels
|
void |
setDefaultChannelType(java.lang.String channelType)
Set the default type of messaging channels (initially ChannelType.LONG_POLLING)
|
void |
setDefaultTimeToLive(long defaultTimeToLive)
Set the default time to live for the channels created by this factory
|
void |
setMessagingTransport(java.lang.String channelType,
Transport messagingTransport)
Set the transport for the specified messaging channel type
|
void |
setMessagingTransport(Transport messagingTransport)
Set the default transport for messaging channels
|
void |
setRemotingTransport(Transport remotingTransport)
Set the transport for remoting channels
|
void |
setScanPackageNames(java.util.Set<java.lang.String> packageNames)
Set of package names to scan
The classes of these packages will be scanned during the start of this factory to find aliased classes
|
void |
setScanPackageNames(java.lang.String... packageNames) |
void |
start()
Start this ChannelFactory
Must be called before trying to create channels and after all properties have been set.
|
void |
stop()
Stop this ChannelFactory
All defined transports are also stopped and unregistered.
|
void |
stop(boolean stopTransports)
Stop this ChannelFactory
Optionally when stopTransports is true all defined transports are also stopped and unregistered.
|
protected final ContentType contentType
protected Transport remotingTransport
protected Transport messagingTransport
protected java.util.Map<java.lang.String,Transport> messagingTransports
protected java.lang.Object context
protected ChannelBuilder defaultChannelBuilder
protected java.util.Set<java.lang.String> scanPackageNames
protected AliasRegistry aliasRegistry
protected java.lang.Long defaultTimeToLive
protected AbstractChannelFactory(ContentType contentType)
protected AbstractChannelFactory(ContentType contentType, java.lang.Object context)
protected AbstractChannelFactory(ContentType contentType, java.lang.Object context, Transport remotingTransport, Transport messagingTransport)
public java.lang.Object getContext()
ChannelFactoryPlatform)getContext in interface ChannelFactoryTransportpublic void setContext(java.lang.Object context)
ChannelFactoryPlatform)setContext in interface ChannelFactorycontext - current contextTransportpublic void setDefaultChannelBuilder(ChannelBuilder channelBuilder)
ChannelFactorysetDefaultChannelBuilder in interface ChannelFactorychannelBuilder - the channel builderDefaultChannelBuilderpublic ContentType getContentType()
ChannelFactorygetContentType in interface ChannelFactoryContentTypepublic long getDefaultTimeToLive()
ChannelFactorygetDefaultTimeToLive in interface ChannelFactorypublic void setDefaultTimeToLive(long defaultTimeToLive)
ChannelFactorysetDefaultTimeToLive in interface ChannelFactorydefaultTimeToLive - time to live in millisecondspublic void setAliasRegistry(AliasRegistry aliasRegistry)
ChannelFactorysetAliasRegistry in interface ChannelFactoryaliasRegistry - alias registryAliasRegistrypublic void setDefaultChannelType(java.lang.String channelType)
ChannelFactorysetDefaultChannelType in interface ChannelFactorychannelType - default type of messaging channelsChannelTypepublic java.lang.String getDefaultChannelType()
ChannelFactorygetDefaultChannelType in interface ChannelFactorypublic Transport getRemotingTransport()
ChannelFactorygetRemotingTransport in interface ChannelFactoryTransportpublic void setRemotingTransport(Transport remotingTransport)
ChannelFactorysetRemotingTransport in interface ChannelFactoryremotingTransport - transportTransportpublic void setMessagingTransport(Transport messagingTransport)
ChannelFactorysetMessagingTransport in interface ChannelFactorymessagingTransport - transportpublic void setMessagingTransport(java.lang.String channelType,
Transport messagingTransport)
ChannelFactorysetMessagingTransport in interface ChannelFactorychannelType - channel typemessagingTransport - transportChannelType,
Transportpublic Transport getMessagingTransport()
ChannelFactorygetMessagingTransport in interface ChannelFactoryTransportpublic java.util.Map<java.lang.String,Transport> getMessagingTransports()
ChannelFactorygetMessagingTransports in interface ChannelFactorypublic Transport getMessagingTransport(java.lang.String channelType)
ChannelFactorygetMessagingTransport in interface ChannelFactorychannelType - channel typeChannelType,
Transportpublic void setScanPackageNames(java.lang.String... packageNames)
public void setScanPackageNames(java.util.Set<java.lang.String> packageNames)
ChannelFactorysetScanPackageNames in interface ChannelFactoryAliasRegistrypublic void start()
ChannelFactorystart in interface ChannelFactorypublic void stop()
ChannelFactorystop in interface ChannelFactorypublic void stop(boolean stopTransports)
ChannelFactorystop in interface ChannelFactorystopTransports - true to stop associated transportspublic RemotingChannel newRemotingChannel(java.lang.String id, java.lang.String uri)
ChannelFactorynewRemotingChannel in interface ChannelFactoryid - identifier for this channeluri - uri of the server to connect toRemotingChannelpublic RemotingChannel newRemotingChannel(java.lang.String id, java.net.URI uri)
ChannelFactoryURInewRemotingChannel in interface ChannelFactoryid - identifier for this channeluri - uri of the server to connect toRemotingChannelpublic RemotingChannel newRemotingChannel(java.lang.String id, ServerApp serverApp)
ChannelFactorynewRemotingChannel in interface ChannelFactoryid - identifier for this channelserverApp - server application to connect toRemotingChannel,
ServerApppublic RemotingChannel newRemotingChannel(java.lang.String id, java.lang.String uri, int maxConcurrentRequests)
ChannelFactorynewRemotingChannel in interface ChannelFactoryid - identifier for this channeluri - uri of the server to connect tomaxConcurrentRequests - maximum number of concurrent requestsRemotingChannelpublic RemotingChannel newRemotingChannel(java.lang.String id, java.net.URI uri, int maxConcurrentRequests)
ChannelFactoryURInewRemotingChannel in interface ChannelFactoryid - identifier for this channeluri - uri of the server to connect tomaxConcurrentRequests - maximum number of concurrent requestsRemotingChannelpublic RemotingChannel newRemotingChannel(java.lang.String id, ServerApp serverApp, int maxConcurrentRequests)
ChannelFactorynewRemotingChannel in interface ChannelFactoryid - identifier for this channelserverApp - server application to connect tomaxConcurrentRequests - maximum number of concurrent requestsRemotingChannel,
ServerAppprotected abstract java.lang.Class<? extends RemotingChannel> getRemotingChannelClass()
public MessagingChannel newMessagingChannel(java.lang.String id, java.lang.String uri)
ChannelFactorynewMessagingChannel in interface ChannelFactoryid - identifier for this channeluri - uri of the server to connect toMessagingChannelpublic MessagingChannel newMessagingChannel(java.lang.String id, java.net.URI uri)
ChannelFactoryURInewMessagingChannel in interface ChannelFactoryid - identifier for this channeluri - uri of the server to connect toMessagingChannelpublic MessagingChannel newMessagingChannel(java.lang.String id, ServerApp serverApp)
ChannelFactorynewMessagingChannel in interface ChannelFactoryid - identifier for this channelserverApp - server application to connect toMessagingChannel,
ServerApppublic MessagingChannel newMessagingChannel(java.lang.String channelType, java.lang.String id, java.lang.String uri)
ChannelFactorynewMessagingChannel in interface ChannelFactorychannelType - a channel typeid - identifier for this channeluri - uri of the server to connect toChannelType,
MessagingChannelpublic MessagingChannel newMessagingChannel(java.lang.String channelType, java.lang.String id, java.net.URI uri)
ChannelFactoryURInewMessagingChannel in interface ChannelFactorychannelType - a channel typeid - identifier for this channeluri - uri of the server to connect toChannelType,
MessagingChannelpublic MessagingChannel newMessagingChannel(java.lang.String channelType, java.lang.String id, ServerApp serverApp)
ChannelFactorynewMessagingChannel in interface ChannelFactorychannelType - a channel typeid - identifier for this channelserverApp - server application to connect toChannelType,
MessagingChannel,
ServerAppprotected abstract <M> MessagingCodec<M> newMessagingCodec(java.lang.Class<M> messageClass)