|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.apama.net.beans.AbstractGenericComponentManagementBean
public abstract class AbstractGenericComponentManagementBean
AbstractGenericComponentManagementBean is a JavaBean that provides a base class upon which JavaBeans using the remote GenericComponentManagement can be built.
Note that changes to the value of the "host", or "port" properties will cause the bean to attempt to re-connect to a server running on a new host/port. This re-connection will happen immediately if the bean was connected at the time of the property change, but will happen later in a "lazy" fashion if there was no existing connection at the time of the property change.
This bean also maintains Boolean bound property called "beanConnected", the value of which is maintained internally. The value will be set to true following a successfull connection to an server, and to false at the time of disconnection. Once connected, a background thread will periodically "ping" the remote server. This background thread will also maintain the value of the "beanConnected" property each time it tests the connection.
Warning: The bound properties supported by this bean will notify all registered listeners from within a synchronized block. Listeners should NOT invoke methods that would cause indirect calls back to synchronized methods in this bean. For example calls to System.exit(int) would cause a deadlock situation when the shutdown handler thread attempted to call disconnect(). However, direct calls from the listener onto synchronized methods of the bean (re-entry) is permitted.
Field Summary | |
---|---|
static int |
DEFAULT_PORT
The default value for the port property. |
Fields inherited from interface com.apama.net.beans.interfaces.BaseClientInterface |
---|
COPYRIGHT, DEFAULT_CONNECTION_POLLING_INTERVAL, DEFAULT_HOST, DEFAULT_PROCESS_NAME, PRODUCTNAME, PROPERTY_BEAN_CONNECTED, PROPERTY_CONNECTION_POLLING_INTERVAL, PROPERTY_HOST, PROPERTY_PORT, PROPERTY_PROCESS_NAME, PROPERTY_VERBOSE, VERSION |
Constructor Summary | |
---|---|
AbstractGenericComponentManagementBean()
Default constructor - as required to be a bean. |
|
AbstractGenericComponentManagementBean(java.lang.String socket_hostname,
int socket_port,
java.lang.String processName)
Full argument constructor. |
Method Summary | |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a property change listener. |
void |
addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Add a property change listener for a specific named property. |
void |
connectNow()
Manually request that the bean connects to the remote server. |
void |
disconnect()
Disconnect from a remote server. |
void |
dispose()
Disconnects the client and also waits to ensure that all background threads and other resources associated with this object have been terminated or freed. |
boolean |
getBeanConnected()
Get the beanConnected property value. |
int |
getConnectionPollingInterval()
Get the polling interval (in milliseconds) for the internal connection test thread. |
java.lang.String |
getHost()
Get the name of the host to be connected to. |
int |
getPort()
Get the port number to be connected to. |
java.lang.String |
getProcessName()
Get the processName in use |
boolean |
getVerbose()
Getter for the verbose property. |
boolean |
isBeanConnected()
Another name for the getBeanConnected() method. |
void |
pingServer()
Manually test if the remote agent process is alive and responding to client requests. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a property change listener. |
void |
removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Remove a property change listener for a specific named property. |
void |
setConnectionPollingInterval(int milliseconds)
Set the polling interval (in milliseconds) for the internal connection test thread. |
void |
setHost(java.lang.String newHostValue)
Setter for the host property. |
void |
setPort(int newPortValue)
Setter for the port property. |
void |
setProcessName(java.lang.String newProcessName)
Setter for the process name property. |
void |
setVerbose(boolean newVerboseValue)
Setter for the verbose property. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_PORT
Constructor Detail |
---|
public AbstractGenericComponentManagementBean()
public AbstractGenericComponentManagementBean(java.lang.String socket_hostname, int socket_port, java.lang.String processName) throws GenericComponentManagementException
socket_hostname
- Name of the host where the server is running.socket_port
- Port number on which the server is listening.processName
- the process name to use
GenericComponentManagementException
- Thrown if any exceptions
occur in the Client SDK.Method Detail |
---|
public void connectNow() throws com.apama.util.CompoundException
pingServer()
from the PingOperationsInterface.
connectNow
in interface BaseClientInterface
com.apama.util.CompoundException
- Thrown if any exceptions occur in the
Client SDK.public void dispose()
BaseClientInterface
dispose
in interface BaseClientInterface
public void disconnect() throws GenericComponentManagementException
The beanConnected property is set to false, and the connection polling thread is terminated.
It is intended that subclasses that override this method call super.disconnect() as the last statement after finishing their local disconnect funtionality. Note however that it is _not_ necessary for all subclasses to override this method.
disconnect
in interface BaseClientInterface
GenericComponentManagementException
- This implementation will
never throw an exception, but subclasses will probably need to do so.public void pingServer() throws com.apama.util.CompoundException
pingServer
in interface PingOperationsInterface
com.apama.util.CompoundException
- when the ping fails.public java.lang.String getHost()
getHost
in interface BaseClientInterface
public void setHost(java.lang.String newHostValue) throws GenericComponentManagementException
setHost
in interface BaseClientInterface
newHostValue
- The new value for the Host property.
GenericComponentManagementException
- Thrown if any exceptions
occur in the Client SDK.public int getPort()
getPort
in interface BaseClientInterface
public void setPort(int newPortValue) throws GenericComponentManagementException
setPort
in interface BaseClientInterface
newPortValue
- The new value for the Port property.
GenericComponentManagementException
- Thrown if any exceptions
occur in the Client SDK.public java.lang.String getProcessName()
getProcessName
in interface BaseClientInterface
public void setProcessName(java.lang.String newProcessName) throws GenericComponentManagementException
setProcessName
in interface BaseClientInterface
newProcessName
- The new value for the process name property.
GenericComponentManagementException
- Thrown if any exceptions
occur in the Client SDK.public boolean isBeanConnected()
isBeanConnected
in interface BaseClientInterface
public boolean getBeanConnected()
getBeanConnected
in interface BaseClientInterface
public int getConnectionPollingInterval()
getConnectionPollingInterval
in interface BaseClientInterface
public void setConnectionPollingInterval(int milliseconds)
setConnectionPollingInterval
in interface BaseClientInterface
milliseconds
- the current interval in millisecondspublic boolean getVerbose()
public void setVerbose(boolean newVerboseValue)
newVerboseValue
- Set to true for more verbose status output.public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener
in interface BaseClientInterface
listener
- the listener to be removed.public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener
in interface BaseClientInterface
listener
- the listener to be added.public void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
removePropertyChangeListener
in interface BaseClientInterface
propertyName
- the name of the property that was listened on.listener
- the listener to be removed.public void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
addPropertyChangeListener
in interface BaseClientInterface
propertyName
- the name of the property to listen on.listener
- the listener to be added.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |