Package com.apama.net.beans
Class GenericComponentManagementBean
- java.lang.Object
- 
- com.apama.net.beans.AbstractGenericComponentManagementBean
- 
- com.apama.net.beans.GenericComponentManagementBean
 
 
- 
- All Implemented Interfaces:
- BaseClientInterface,- GenericComponentManagementOperationsInterface,- PingClientInterface,- PingOperationsInterface,- java.lang.AutoCloseable
 
 public class GenericComponentManagementBean extends AbstractGenericComponentManagementBean implements GenericComponentManagementOperationsInterface GenericComponentManagementBean is a JavaBean that provides a way of controlling an arbitrary server that exports a GenericComponentManagement interface. The bean is intended to be a building block for the creation of client applications.The main() method provides the ability to run the bean from the command line. Note that changes to the value of the "host" or "port" properties that are inherited from the superclass 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. General pattern of use: - Construct (optionally providing initial values for the host and port properties)
- [Optional] Set property values
- Tell server to perform actions.
 
- 
- 
Field Summary- 
Fields inherited from class com.apama.net.beans.AbstractGenericComponentManagementBeanDEFAULT_PORT
 - 
Fields inherited from interface com.apama.net.beans.interfaces.BaseClientInterfaceCOPYRIGHT, DEFAULT_CONNECTION_POLLING_INTERVAL, DEFAULT_HOST, DEFAULT_PORT, DEFAULT_PROCESS_NAME, PROPERTY_BEAN_CONNECTED, PROPERTY_CONNECTION_POLLING_INTERVAL, PROPERTY_HOST, PROPERTY_PORT, PROPERTY_PROCESS_NAME, PROPERTY_VERBOSE, VERSION
 
- 
 - 
Constructor SummaryConstructors Constructor Description GenericComponentManagementBean()Default constructor - as required to be a bean.GenericComponentManagementBean(java.lang.String socket_hostname, int socket_port, java.lang.String processName)Full argument constructor.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandeepPing()Ask the remote server to perform a 'deep ping' operation.booleandisconnectReceiverByComponentId(com.apama.message.ComponentIDTuple id, java.lang.String why)Disconnect the receiver connected to this component that has component ID id.booleandisconnectSenderByComponentId(com.apama.message.ComponentIDTuple id, java.lang.String why)Disconnect the sender connected to this component that has component ID id.java.lang.StringdoRequest(java.lang.String type, java.lang.String[] args)Execute a component-specific commandjava.lang.StringgetBuildNumber()Get the component's build numberjava.lang.StringgetBuildPlatform()Get the component's build platformjava.lang.StringgetComponentVersion()Get the component's version numberGenericComponentManagement.GenericComponentConnectionSetgetConnections()java.lang.StringgetCurrentDirectory()Get the component's current working directory pathjava.lang.StringgetHostname()Get the hostname that component is running onGenericComponentManagement.GenericComponentInfogetInfo(java.lang.String category)Request component-specific status/configuration informationlonggetLogicalId()Get the unique logical ID of the componentGenericComponentManagement.GenericComponentLogLevelgetLogLevel()Get the component's current logging leveljava.lang.StringgetName()Get the name of the component, encoded as UTF-8longgetPhysicalId()Get the globally unique physical ID of the componentlonggetPID()Return the process identifier of the remote server.floatgetPMemory()Get the physical memory usage of the component, in megabytesjava.lang.StringgetProductVersion()Get the version number of the product the component belongs tointgetRemotePort()Get the port number that the component is listening onjava.lang.StringgetType()Get the type of the component, encoded as UTF-8intgetUptime()Get the uptime of the component, in msjava.lang.StringgetUsername()Get the effective username the component is running asfloatgetVMemory()Get the virtual memory usage of the component, in megabytesbooleanisGenericComponentManagementAvailable()Return true if the remote server actually implements the GenericComponentManagement interface.static voidmain(java.lang.String[] args)This bean can be invoked from the command prompt.voidsetLogLevel(GenericComponentManagement.GenericComponentLogLevel logLevel)Set the component's logging levelvoidshutdown(java.lang.String why)Tell the remote server to shut itself down.- 
Methods inherited from class com.apama.net.beans.AbstractGenericComponentManagementBeanaddPropertyChangeListener, addPropertyChangeListener, close, connectNow, disconnect, dispose, getBeanConnected, getConnectionPollingInterval, getHost, getPort, getProcessName, getVerbose, isBeanConnected, pingServer, removePropertyChangeListener, removePropertyChangeListener, setConnectionPollingInterval, setHost, setPort, setProcessName, setVerbose
 - 
Methods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface com.apama.net.beans.interfaces.BaseClientInterfaceaddPropertyChangeListener, addPropertyChangeListener, close, connectNow, disconnect, dispose, getBeanConnected, getConnectionPollingInterval, getHost, getPort, getProcessName, isBeanConnected, removePropertyChangeListener, removePropertyChangeListener, setConnectionPollingInterval, setHost, setPort, setProcessName
 - 
Methods inherited from interface com.apama.net.beans.interfaces.PingOperationsInterfacepingServer
 
- 
 
- 
- 
- 
Constructor Detail- 
GenericComponentManagementBeanpublic GenericComponentManagementBean() Default constructor - as required to be a bean. Initialises the bean with default values for the properties. This default constructor does not make a connection to a remote server.
 - 
GenericComponentManagementBeanpublic GenericComponentManagementBean(java.lang.String socket_hostname, int socket_port, java.lang.String processName) throws GenericComponentManagementExceptionFull argument constructor. Calls the super constructor, then connects to a remote server.- Parameters:
- 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
- Throws:
- GenericComponentManagementException- Thrown if any exceptions occur in the Client SDK.
 
 
- 
 - 
Method Detail- 
isGenericComponentManagementAvailablepublic boolean isGenericComponentManagementAvailable() Return true if the remote server actually implements the GenericComponentManagement interface.- Specified by:
- isGenericComponentManagementAvailablein interface- GenericComponentManagementOperationsInterface
 
 - 
deepPingpublic boolean deepPing() throws GenericComponentManagementExceptionAsk the remote server to perform a 'deep ping' operation. Unlike a normal 'ping' that just tests connectivity to the server, a deep ping is expected to exercise the server in such a way that the caller will have a reasonable expectation that the server is working, if this method returns true.- Specified by:
- deepPingin interface- GenericComponentManagementOperationsInterface
- Returns:
- True if the deep ping succeeded, false otherwise.
- Throws:
- GenericComponentManagementException- Thrown if any exceptions occur in the Client SDK.
 
 - 
getPIDpublic long getPID() throws GenericComponentManagementExceptionReturn the process identifier of the remote server. This is primarily useful if the server becomes unresponsive and needs to be killed.- Specified by:
- getPIDin interface- GenericComponentManagementOperationsInterface
- Returns:
- The process identifier of the remote server.
- Throws:
- GenericComponentManagementException- Thrown if any exceptions occur in the Client SDK.
 
 - 
shutdownpublic void shutdown(java.lang.String why) throws GenericComponentManagementExceptionTell the remote server to shut itself down. This is a command, not a request. The remote server should expect that the client will wait for a reasonable interval for it to die (testing this by pinging it) then take more extreme steps to terminate the server.- Specified by:
- shutdownin interface- GenericComponentManagementOperationsInterface
- Parameters:
- why- Message that the server can write to its logs, indicating why it was shut down.
- Throws:
- GenericComponentManagementException- Thrown if any exceptions occur in the Client SDK.
 
 - 
disconnectReceiverByComponentIdpublic boolean disconnectReceiverByComponentId(com.apama.message.ComponentIDTuple id, java.lang.String why) throws GenericComponentManagementExceptionDisconnect the receiver connected to this component that has component ID id. IDs can be discovered through the getConnections() call. You can provide a reason.- Parameters:
- id- the ID
- why- free form text that is sent to the remote receiver
- Throws:
- GenericComponentManagementException
- See Also:
- getConnections()
 
 - 
disconnectSenderByComponentIdpublic boolean disconnectSenderByComponentId(com.apama.message.ComponentIDTuple id, java.lang.String why) throws GenericComponentManagementExceptionDisconnect the sender connected to this component that has component ID id. IDs can be discovered through the getConnections() call. You can provide a reason.- Parameters:
- id- the ID
- why- free form text that is sent to the remote sender
- Throws:
- GenericComponentManagementException
- See Also:
- getConnections()
 
 - 
getNamepublic java.lang.String getName() throws GenericComponentManagementExceptionDescription copied from interface:GenericComponentManagementOperationsInterfaceGet the name of the component, encoded as UTF-8- Specified by:
- getNamein interface- GenericComponentManagementOperationsInterface
- Throws:
- GenericComponentManagementException
 
 - 
getTypepublic java.lang.String getType() throws GenericComponentManagementExceptionDescription copied from interface:GenericComponentManagementOperationsInterfaceGet the type of the component, encoded as UTF-8- Specified by:
- getTypein interface- GenericComponentManagementOperationsInterface
- Throws:
- GenericComponentManagementException
 
 - 
getUptimepublic int getUptime() throws GenericComponentManagementExceptionDescription copied from interface:GenericComponentManagementOperationsInterfaceGet the uptime of the component, in ms- Specified by:
- getUptimein interface- GenericComponentManagementOperationsInterface
- Throws:
- GenericComponentManagementException
 
 - 
getVMemorypublic float getVMemory() throws GenericComponentManagementExceptionDescription copied from interface:GenericComponentManagementOperationsInterfaceGet the virtual memory usage of the component, in megabytes- Specified by:
- getVMemoryin interface- GenericComponentManagementOperationsInterface
- Throws:
- GenericComponentManagementException
 
 - 
getPMemorypublic float getPMemory() throws GenericComponentManagementExceptionDescription copied from interface:GenericComponentManagementOperationsInterfaceGet the physical memory usage of the component, in megabytes- Specified by:
- getPMemoryin interface- GenericComponentManagementOperationsInterface
- Throws:
- GenericComponentManagementException
 
 - 
getPhysicalIdpublic long getPhysicalId() throws GenericComponentManagementExceptionDescription copied from interface:GenericComponentManagementOperationsInterfaceGet the globally unique physical ID of the component- Specified by:
- getPhysicalIdin interface- GenericComponentManagementOperationsInterface
- Throws:
- GenericComponentManagementException
 
 - 
getLogicalIdpublic long getLogicalId() throws GenericComponentManagementExceptionDescription copied from interface:GenericComponentManagementOperationsInterfaceGet the unique logical ID of the component- Specified by:
- getLogicalIdin interface- GenericComponentManagementOperationsInterface
- Throws:
- GenericComponentManagementException
 
 - 
getLogLevelpublic GenericComponentManagement.GenericComponentLogLevel getLogLevel() throws GenericComponentManagementException Description copied from interface:GenericComponentManagementOperationsInterfaceGet the component's current logging level- Specified by:
- getLogLevelin interface- GenericComponentManagementOperationsInterface
- Throws:
- GenericComponentManagementException
 
 - 
setLogLevelpublic void setLogLevel(GenericComponentManagement.GenericComponentLogLevel logLevel) throws GenericComponentManagementException Description copied from interface:GenericComponentManagementOperationsInterfaceSet the component's logging level- Specified by:
- setLogLevelin interface- GenericComponentManagementOperationsInterface
- Throws:
- GenericComponentManagementException
 
 - 
getComponentVersionpublic java.lang.String getComponentVersion() throws GenericComponentManagementExceptionDescription copied from interface:GenericComponentManagementOperationsInterfaceGet the component's version number- Specified by:
- getComponentVersionin interface- GenericComponentManagementOperationsInterface
- Throws:
- GenericComponentManagementException
 
 - 
getProductVersionpublic java.lang.String getProductVersion() throws GenericComponentManagementExceptionDescription copied from interface:GenericComponentManagementOperationsInterfaceGet the version number of the product the component belongs to- Specified by:
- getProductVersionin interface- GenericComponentManagementOperationsInterface
- Throws:
- GenericComponentManagementException
 
 - 
getBuildNumberpublic java.lang.String getBuildNumber() throws GenericComponentManagementExceptionDescription copied from interface:GenericComponentManagementOperationsInterfaceGet the component's build number- Specified by:
- getBuildNumberin interface- GenericComponentManagementOperationsInterface
- Throws:
- GenericComponentManagementException
 
 - 
getBuildPlatformpublic java.lang.String getBuildPlatform() throws GenericComponentManagementExceptionDescription copied from interface:GenericComponentManagementOperationsInterfaceGet the component's build platform- Specified by:
- getBuildPlatformin interface- GenericComponentManagementOperationsInterface
- Throws:
- GenericComponentManagementException
 
 - 
getHostnamepublic java.lang.String getHostname() throws GenericComponentManagementExceptionDescription copied from interface:GenericComponentManagementOperationsInterfaceGet the hostname that component is running on- Specified by:
- getHostnamein interface- GenericComponentManagementOperationsInterface
- Throws:
- GenericComponentManagementException
 
 - 
getUsernamepublic java.lang.String getUsername() throws GenericComponentManagementExceptionDescription copied from interface:GenericComponentManagementOperationsInterfaceGet the effective username the component is running as- Specified by:
- getUsernamein interface- GenericComponentManagementOperationsInterface
- Throws:
- GenericComponentManagementException
 
 - 
getCurrentDirectorypublic java.lang.String getCurrentDirectory() throws GenericComponentManagementExceptionDescription copied from interface:GenericComponentManagementOperationsInterfaceGet the component's current working directory path- Specified by:
- getCurrentDirectoryin interface- GenericComponentManagementOperationsInterface
- Throws:
- GenericComponentManagementException
 
 - 
getRemotePortpublic int getRemotePort() throws GenericComponentManagementExceptionDescription copied from interface:GenericComponentManagementOperationsInterfaceGet the port number that the component is listening on- Specified by:
- getRemotePortin interface- GenericComponentManagementOperationsInterface
- Throws:
- GenericComponentManagementException
 
 - 
doRequestpublic java.lang.String doRequest(java.lang.String type, java.lang.String[] args) throws GenericComponentManagementExceptionDescription copied from interface:GenericComponentManagementOperationsInterfaceExecute a component-specific command- Specified by:
- doRequestin interface- GenericComponentManagementOperationsInterface
- Throws:
- GenericComponentManagementException
 
 - 
getInfopublic GenericComponentManagement.GenericComponentInfo getInfo(java.lang.String category) throws GenericComponentManagementException Description copied from interface:GenericComponentManagementOperationsInterfaceRequest component-specific status/configuration information- Specified by:
- getInfoin interface- GenericComponentManagementOperationsInterface
- Throws:
- GenericComponentManagementException
 
 - 
getConnectionspublic GenericComponentManagement.GenericComponentConnectionSet getConnections() throws GenericComponentManagementException 
 - 
mainpublic static void main(java.lang.String[] args) This bean can be invoked from the command prompt. Invoke with "--help" as parameter to print usage information.
 
- 
 
-