public interface TransportFactory
extends javax.naming.Referenceable, java.io.Serializable
Title: Open Service Framework
Description: A Transport Factory
interface represents a serializable configuraton object that
allows service developers to create connections to Message System communication substrates.
This interface may be used in conjunction with Referenceable
factories such as those supported
by JNDI
, or it may provide a wrapping mechanism that offers Referenceable
support
for connection definitions that do not normally support Naming
and JNDI
interfaces.
Transport Factory
objects are created as serializable entities that are intended to be persisted
into an Entity Repository
. The artifact that represents a factory is an XML document. Reference
to the artifact may be added as a parameter to the AbstractServiceConfigurationObject
implementation. The default implementation is the ServiceConfigurationObject
.
The property will be presented as a ServiceConfigurationProperty
property with
ServicePropertyType.TRANSPORT_FACTORY
type.
At Service initialization time the factory's reference will be resolved and the factory artifact will be marshaled
back into an object. If the factory isLifeCycleManaged()
the Container Context
will automatically
manage the connection's life cycle. For instance the connection will be started when the service is started and it
will re-cycle and stop along with the service. The resulting connection's state may be monitored by a
State Notification Event Listener
that maybe set on the connection. Any logging that the
connection may perform can likewise be routed to a particular logger mechanism such as that used by the Service.
The factory provides methods that allow the Service to be automatically associated with error logging and
state notification. Alternatively Service developers may choose to control life cycle, logging and event management
them selves by specifying their own components.
Copyright: Copyright (c) 2009
Company: StreamScape Technologies
Modifier and Type | Field and Description |
---|---|
static long |
Day |
static long |
Hour |
static long |
Minute |
static long |
Second |
Modifier and Type | Method and Description |
---|---|
TransportConnection |
createConnection()
Creates a connection using default credentials.
|
TransportConnection |
createConnection(java.lang.String connectionName,
java.lang.String userName,
java.lang.String password)
Creates a named connection and loads it into the reference list.
|
void |
destroyAll()
Cleans up all transient objects and frees up all resources created by this
factory.
|
long |
getConnectionCheckInterval()
Returns the number of milliseconds between checks of the connection's
state.
|
java.lang.String |
getConnectionFactoryClass()
Returns the name of the factory class that is the implementation of the underlying connection factory.
|
java.lang.String |
getConnectionStateValidatorClass()
Returns the name of the connection state validator class.
|
int |
getConnectionTimeout()
Gets the number of seconds the connection attempt will wait before
throwing an exception.
|
java.lang.String |
getDefaultPassword()
Gets the default password.
|
java.lang.String |
getDefaultUrl()
Gets the default URL.
|
java.lang.String |
getDefaultUser()
Gets the default user.
|
java.lang.String |
getDescription() |
java.lang.String |
getFactoryName()
Returns the name of the transport factory instance.
|
java.lang.String |
getFactoryType()
Returns the factory Type.
|
int |
getMajorVersion()
Returns the major version of the factory.
|
int |
getMinorVersion()
Returns the minor version of the factory
|
java.util.Properties |
getProperties() |
java.lang.String |
getProperty(java.lang.String name)
Returns the value of a specified property.
|
long |
getReconnectInterval()
Returns the frequency at which to check the connection's state in milliseconds (when connection is in RECONNECT state).
|
int |
getTransportReconnectRetries()
Returns the number of times a connection will try to reconnect.
|
java.util.List |
getURLs()
Returns a list of one or more URls that comprise the URL list.
|
java.lang.String |
getVendorString()
Returns the complete version string.
|
boolean |
isLifeCycleManaged()
Returns
true if the factory's connection life cycle is to be
managed by the Service Context. |
boolean |
isReliableConnection()
Returns
true if the connection created by the factory is
reliable. |
java.util.Vector |
listConnections()
Returns a list (vector) of all connections in this factory's pool.
|
java.util.Vector |
listFactoryProperties()
Lists all the properties of this factory by loading the provider and
introspecting the getter/setter methods.
|
TransportConnection |
lookupConnection(java.lang.String connectionName)
Returns a connction from the pool specified by the name.
|
void |
pingConnection()
Tests the connection using the connection properties of this factory.
|
void |
removeConnection(java.lang.String name)
Removes a connection from the factory pool.
|
void |
setConnectionCheckInterval(long millis)
Sets the frequencey at which ot check the connection's state in
milliseconds.
|
void |
setConnectionFactoryClass(java.lang.String connectionClassName)
Sets the name of the factory class that is the implementation of the underlying connection factory.
|
void |
setConnectionStateValidatorClass(java.lang.String validatorClassName)
Sets the connection state validator class.
|
void |
setConnectionTimeout(int seconds)
Sets the number of seconds to wait for a successfull connection before
throwing an exception.
|
void |
setDefaultPassword(java.lang.String password)
Sets the default password
|
void |
setDefaultUrl(java.lang.String url)
Sets the default URL.
|
void |
setDefaultUser(java.lang.String userName)
Sets the default user.
|
void |
setDescription(java.lang.String desc) |
void |
setFactoryName(java.lang.String name)
Sets the name of this factory.
|
void |
setFactoryType(java.lang.String type)
Sets the factory type name.
|
void |
setLifeCycleManaged(boolean auto)
Sets wether this factory's connection life cycle is managed by the
container context or not.
|
void |
setProperty(java.lang.String name,
java.lang.String value)
Sets the value of a property for this factory.
|
void |
setReconnectInterval(long millis)
Sets the frequency at which to check the connection's state in milliseconds (when connection is in RECONNECT state).
|
void |
setReliableConnection(boolean reliable)
Specifies if the connection that is created will be reliable.
|
void |
setTransportReconnectRetries(int retry)
Sets the number of times that a reliable connection tries to reconnect.
|
void |
setURLs(java.util.List urls)
Sets URL list which is build out of all provided TransportURLs.
|
static final long Day
static final long Hour
static final long Minute
static final long Second
java.lang.String getFactoryName()
void setFactoryName(java.lang.String name)
name
- Stringjava.lang.String getFactoryType()
void setFactoryType(java.lang.String type)
type
- Stringint getMajorVersion()
int getMinorVersion()
java.lang.String getVendorString()
void setDefaultUser(java.lang.String userName)
userName
- Stringjava.lang.String getDefaultUser()
void setDefaultUrl(java.lang.String url)
userName
- Stringjava.lang.String getDefaultUrl()
void setDefaultPassword(java.lang.String password)
password
- Stringjava.lang.String getDefaultPassword()
boolean isLifeCycleManaged()
true
if the factory's connection life cycle is to be
managed by the Service Context. When true
the connection will
be started (connected) implicitly as part of the
Service.start()
method. The connection is
established immediately before method is invoked. If the connection
attempt results in a failure the service is put into suspended mode
on platforms that support this mode. Otherwise the service is placed into
stopped mode. If the factory defines a reliable connection the
connection's retry cycle completes prior to the Service transitioning into
a stopped or suspended mode.void setLifeCycleManaged(boolean auto)
auto
- booleanvoid setReliableConnection(boolean reliable)
TransportException
occurs.
The reconnect is attempted based on reconnection retries and timouts. If
the connection does not succeed the service is placed in a
Suspended state or Stopped state depending on what the
service hosting environment supports.reliable
- booleanboolean isReliableConnection()
true
if the connection created by the factory is
reliable.void setTransportReconnectRetries(int retry)
retry
- intint getTransportReconnectRetries()
void pingConnection() throws TransportException
java.lang.Exception
TransportException
void destroyAll() throws TransportConfigurationException
TransportFactoryConfigurationException
TransportConfigurationException
TransportConnection lookupConnection(java.lang.String connectionName) throws TransportConfigurationException
connectionName
- StringTransportFactoryConfigurationException
TransportConfigurationException
java.util.Vector listFactoryProperties() throws TransportConfigurationException
TransportFactoryConfigurationException
TransportConfigurationException
void removeConnection(java.lang.String name) throws TransportConfigurationException
name
- StringTransportFactoryConfigurationException
TransportConfigurationException
java.util.Vector listConnections()
java.lang.String getProperty(java.lang.String name) throws TransportConfigurationException
name
- StringTransportFactoryConfigurationException
TransportConfigurationException
void setProperty(java.lang.String name, java.lang.String value) throws TransportConfigurationException
name
- Stringvalue
- StringTransportFactoryConfigurationException
TransportConfigurationException
long getConnectionCheckInterval()
void setConnectionCheckInterval(long millis)
millis
- longvoid setReconnectInterval(long millis)
millis
- longlong getReconnectInterval()
int getConnectionTimeout()
void setConnectionTimeout(int seconds)
seconds
- intjava.lang.String getConnectionFactoryClass()
void setConnectionFactoryClass(java.lang.String connectionClassName)
connectionClassName
- StringTransportConnection createConnection() throws TransportException
Sys$Default.[factoryType].[factoryName]
using the
lookupConnection(java.lang.String)
method.TransportFactoryConfigurationException
TransportException
TransportConnection createConnection(java.lang.String connectionName, java.lang.String userName, java.lang.String password) throws TransportException
lookupConnection(java.lang.String)
method.connectionName
- StringuserName
- Stringpassword
- StringTransportFactoryConfigurationException
TransportException
java.util.List getURLs()
void setURLs(java.util.List urls)
void setConnectionStateValidatorClass(java.lang.String validatorClassName)
connect
operation.validatorClassName
- Stringjava.lang.String getConnectionStateValidatorClass()
java.lang.String getDescription()
void setDescription(java.lang.String desc)
java.util.Properties getProperties()
Copyright © 2015-2024 StreamScape Technologies. All rights reserved.