Class ServerPlugin
java.lang.Object
ecmwf.common.technical.ThreadService.ConfigurableRunnable
ecmwf.common.plugin.PluginThread
ecmwf.common.plugin.ServerPlugin
- All Implemented Interfaces:
MBeanService
,Runnable
- Direct Known Subclasses:
FtpPlugin
,SimplePlugin
The Class ServerPlugin.
-
Field Summary
Fields inherited from class ecmwf.common.plugin.PluginThread
_params
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addConnection
(Socket socket, ServerPlugin info) Adds the connection.void
callerBack
(boolean reset) Caller back.void
Caller gone.void
Configurable run.void
customizeSocket
(Socket socket) Customize socket.getAttribute
(String attributeName) Gets the attribute.Gets the header.Gets the inet address.getInfo()
Gets the info.Gets the MBean info.abstract int
getPort()
Gets the port.Gets the remote host.Gets the remote ip.ecmwf.common.plugin.ServerPlugin.ServerPluginDescriptor
Gets the server plugin descriptor.Gets the socket.Invoke.boolean
Checks if is available.abstract ThreadService.ConfigurableRunnable
Get instance of current class.abstract void
refuseConnection
(Socket socket, int connectionsCount) Refuse connection.void
releaseConnection
(Socket socket, boolean close) Release connection.void
setCloseOnExit
(boolean close) Sets the close on exit.boolean
start()
Start.abstract void
startConnection
(Socket socket) Start connection.void
stop()
Stop.Methods inherited from class ecmwf.common.plugin.PluginThread
getCaller, getParam, getPluginContainer, getPluginName, getRef, getVersion, handle, handle, setAttribute, setCaller, setPluginContainer, subscribe, unSubscribe
Methods inherited from class ecmwf.common.technical.ThreadService.ConfigurableRunnable
execute, execute, getContextClassLoader, getPriority, getThreadName, interrupt, interrupted, isAlive, isStarted, join, join, run, setContextClassLoader, setForceCookie, setInheritCookie, setPriority, setThreadNameAndCookie
-
Constructor Details
-
ServerPlugin
Instantiates a new server plugin.- Parameters:
ref
- the refparams
- the paramssocket
- the socket- Throws:
IOException
- Signals that an I/O exception has occurred.
-
ServerPlugin
-
-
Method Details
-
getSocket
-
getInfo
-
customizeSocket
Customize socket.- Parameters:
socket
- the socket- Throws:
IOException
- Signals that an I/O exception has occurred.
-
newInstance
public abstract ThreadService.ConfigurableRunnable newInstance(String ref, Map<String, String> params, Socket socket) throws IOExceptionGet instance of current class.- Parameters:
ref
- the refparams
- the paramssocket
- the socket- Returns:
- the configurable runnable
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
configurableRun
public void configurableRun()Configurable run. Configurable run. Configurable run.- Overrides:
configurableRun
in classPluginThread
-
addConnection
Adds the connection.- Parameters:
socket
- the socketinfo
- the info
-
callerBack
public void callerBack(boolean reset) Caller back. Caller back.- Overrides:
callerBack
in classPluginThread
- Parameters:
reset
- the reset
-
callerGone
-
releaseConnection
Release connection.- Parameters:
socket
- the socketclose
- the close
-
getHeader
-
getPort
public abstract int getPort()Gets the port.- Returns:
- the port
-
getInetAddress
-
getRemoteHost
-
getRemoteIP
-
isAvailable
public boolean isAvailable()Checks if is available.- Returns:
- true, if is available
-
setCloseOnExit
public void setCloseOnExit(boolean close) Sets the close on exit.- Parameters:
close
- the new close on exit
-
start
public boolean start()Start. Start.- Specified by:
start
in classPluginThread
- Returns:
- true, if successful
-
startConnection
Start connection.- Parameters:
socket
- the socket- Throws:
IOException
- Signals that an I/O exception has occurred.
-
refuseConnection
Refuse connection.- Parameters:
socket
- the socketconnectionsCount
- the connections count- Throws:
IOException
- Signals that an I/O exception has occurred.
-
stop
-
getAttribute
Gets the attribute. Gets the attribute. Gets the attribute.- Specified by:
getAttribute
in interfaceMBeanService
- Overrides:
getAttribute
in classPluginThread
- Parameters:
attributeName
- the attribute name- Returns:
- the attribute
- Throws:
AttributeNotFoundException
- the attribute not found exceptionMBeanException
- the MBean exception
-
getMBeanInfo
Gets the MBean info. Gets the MBean info. Gets the MBean info.- Specified by:
getMBeanInfo
in interfaceMBeanService
- Overrides:
getMBeanInfo
in classPluginThread
- Returns:
- the MBean info
-
getServerPluginDescriptor
public ecmwf.common.plugin.ServerPlugin.ServerPluginDescriptor getServerPluginDescriptor()Gets the server plugin descriptor.- Returns:
- the server plugin descriptor
-
invoke
public Object invoke(String operationName, Object[] params, String[] signature) throws NoSuchMethodException, MBeanException Invoke. Invoke. Invoke.- Specified by:
invoke
in interfaceMBeanService
- Overrides:
invoke
in classPluginThread
- Parameters:
operationName
- the operation nameparams
- the paramssignature
- the signature- Returns:
- the object
- Throws:
NoSuchMethodException
- the no such method exceptionMBeanException
- the MBean exception
-