|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.norther.tammi.core.base.Adaptee
org.norther.tammi.spray.connector.DefaultConnector
public class DefaultConnector
A default implementation of Connector. The start and stop methods must be implemented by subclasses.
| Field Summary | |
|---|---|
protected static InetAddress |
LOCALHOST
The default local host. |
| Fields inherited from class org.norther.tammi.core.base.Adaptee |
|---|
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS |
| Fields inherited from interface org.norther.tammi.core.base.MBeanDelegate |
|---|
ARRAY_TYPE, OBJECT_TYPE, PRIMITIVE_TYPE, STRING_TYPE |
| Constructor Summary | |
|---|---|
|
DefaultConnector()
Constructs a new connector. |
protected |
DefaultConnector(InetAddress addr)
Constructs a connector with a host address. |
| Method Summary | |
|---|---|
String |
getAddress()
Gets the address of the server of the connection. |
int |
getConnectionCount()
Gets a snapshot of the number of active and idle connections. |
int |
getConnectionTimeout()
Gets the timeout to wait for a request from an idle connection. |
protected MBeanReference |
getFilterMBean()
Gets a reference to the filter MBean. |
ObjectName |
getFilterName()
Gets the filter processing the requests. |
protected InetAddress |
getInetAddress()
Gets the inet address of the local host if set. |
String |
getKeyAlias()
Gets the certificate key alias of the connection. |
protected MBeanReference |
getLoggerMBean()
Gets a reference to the logger MBean. |
ObjectName |
getLoggerName()
Gets the the access logger of this connector. |
int |
getMaxIdleConnections()
Gets the maximum number of idle connections to keep alive. |
String |
getName()
Gets the name of the server of the connection. |
int |
getPort()
Gets the port of the connector. |
String |
getProvider()
Gets the provider of the connection. |
int |
getRedirectPort()
Gets the port of the corresponding secure/non-secure port to redirect requests. |
int |
getRequestTimeout()
Gets the timeout for the processing time of one client request. |
protected MBeanReference |
getTimeoutMBean()
Gets a reference to the timeout MBean. |
boolean |
isKeepConnection()
Checks whether to keep connections alive on idle after processing the corresponding requests if applicable. |
boolean |
isLoggingDisabled()
Checks whether access logging of this connector is disabled. |
boolean |
isSecure()
Checks the secure connections flag. |
boolean |
isStarted()
Checks whether the startable has been started. |
boolean |
keepConnection(Connection con)
Keeps the specified connection alive on idle after processing the corresponding request if applicable. |
void |
postmanaged()
This method is called when the implementing adaptee has been managed either during post-registration of the corresponding adapter MBean or just after it is explicitly added to the adapter MBean during run-time. |
protected void |
setAddress(String addr)
Sets the address of the server of the connection. |
void |
setConnectionTimeout(int timeout)
Sets the timeout to wait for a request in an idle connection. |
void |
setFilterName(ObjectName filter)
Sets the filter processing the requests. |
protected void |
setInetAddress(InetAddress addr)
Sets the inet address of the local host. |
void |
setKeyAlias(String alias)
Sets the certificate key alias of the connection. |
void |
setKeyPassword(String pswd)
Sets the certificate key password of the connection. |
void |
setLoggerName(ObjectName logger)
Sets the access logger of this connector. |
void |
setLoggingDisabled(boolean flag)
Sets whether access logging of this connector is disabled. |
void |
setMaxIdleConnections(int count)
Sets the maximum number of idle connections to keep alive. |
void |
setPort(int port)
Sets the port of the connector. |
void |
setProvider(String name)
Sets the provider of the connection. |
void |
setRedirectPort(int port)
Sets the port of the corresponding secure/non-secure port to redirect requests. |
void |
setRequestTimeout(int timeout)
Sets the timeout for the processing time of one client request. |
void |
setSecure(boolean secure)
Sets the secure connections flag. |
void |
start()
Starts the MBean. |
void |
stop()
Stops the MBean. |
void |
unmanaged()
This method is called when the implementing adaptee is unmanaged either during pre-deregistration of the corresponding adapter MBean or just before it is explicitly removed from the adapter MBean during run-time. |
| Methods inherited from class org.norther.tammi.core.base.Adaptee |
|---|
addAdaptee, addNotificationListener, getAttributeSupport, getBroker, getCanonicalName, getDomain, getFactory, getLoader, getLog, getLog, getMBean, getMBeanServer, getNotificationInfo, getObjectName, getRegistrationTime, getSequenceNumber, hasListeners, isRegistered, premanaged, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification, sendNotification, unregister |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final InetAddress LOCALHOST
| Constructor Detail |
|---|
public DefaultConnector()
protected DefaultConnector(InetAddress addr)
addr - the host address.| Method Detail |
|---|
public void postmanaged()
Manageable
postmanaged in interface Manageablepostmanaged in class Adaptee
public void unmanaged()
throws Exception
Manageable
unmanaged in interface Manageableunmanaged in class AdapteeException - if the adaptee refused to be unmanaged.public String getName()
Connector
getName in interface Connectorpublic String getAddress()
Connector
getAddress in interface Connectorpublic String getProvider()
Connector
getProvider in interface Connectorpublic void setProvider(String name)
Connector
setProvider in interface Connectorname - the name of the provider.public String getKeyAlias()
Connector
getKeyAlias in interface Connectorpublic void setKeyAlias(String alias)
Connector
setKeyAlias in interface Connectoralias - the key alias.public void setKeyPassword(String pswd)
Connector
setKeyPassword in interface Connectorpswd - the key pssword.public int getPort()
Connector
getPort in interface Connectorpublic void setPort(int port)
Connector
setPort in interface Connectorport - the port number.public int getRedirectPort()
Connector
getRedirectPort in interface Connectorpublic void setRedirectPort(int port)
Connector
setRedirectPort in interface Connectorport - the redirect port number.public boolean isSecure()
Connector
isSecure in interface Connectorpublic void setSecure(boolean secure)
Connector
setSecure in interface Connectorsecure - the secure connections flag.public ObjectName getFilterName()
Connector
getFilterName in interface Connectorpublic void setFilterName(ObjectName filter)
Connector
setFilterName in interface Connectorfilter - the name or pattern of the filter.public int getRequestTimeout()
Connector
getRequestTimeout in interface Connectorpublic void setRequestTimeout(int timeout)
Connector
setRequestTimeout in interface Connectortimeout - a new timeout for requests in msecs.public int getConnectionTimeout()
Connector
getConnectionTimeout in interface Connectorpublic void setConnectionTimeout(int timeout)
Connector
setConnectionTimeout in interface Connectortimeout - the timeout for connections in msecs.public int getMaxIdleConnections()
Connector
getMaxIdleConnections in interface Connectorpublic void setMaxIdleConnections(int count)
ConnectorNote that how to apply the limit to the active number of connections is implementation dependent.
setMaxIdleConnections in interface Connectorcount - the max number of idle connections.public int getConnectionCount()
ConnectorNote that the count is implementation dependent and its accuracy may vary.
getConnectionCount in interface Connectorpublic boolean isLoggingDisabled()
Connector
isLoggingDisabled in interface Connectorpublic void setLoggingDisabled(boolean flag)
Connector
setLoggingDisabled in interface Connectorflag - true if logging is disabled, false otherwise.public ObjectName getLoggerName()
Connector
getLoggerName in interface Connectorpublic void setLoggerName(ObjectName logger)
Connector
setLoggerName in interface Connectorlogger - the object name of the logger or a query.public boolean isKeepConnection()
Connector
isKeepConnection in interface Connectorpublic boolean keepConnection(Connection con)
Connector
keepConnection in interface Connectorcon - the connection.
public boolean isStarted()
Startable
isStarted in interface Startable
public void start()
throws Exception
Startable
start in interface StartableException - if start fails.public void stop()
Startable
stop in interface Startableprotected MBeanReference getFilterMBean()
protected MBeanReference getLoggerMBean()
protected MBeanReference getTimeoutMBean()
protected void setAddress(String addr)
throws UnknownHostException
addr - the address of the server.
UnknownHostException - if not found.protected InetAddress getInetAddress()
protected void setInetAddress(InetAddress addr)
addr - the inet address or null.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||