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 TypeMethodDescriptionvoidaddConnection(Socket socket, ServerPlugin info) Adds the connection.voidcallerBack(boolean reset) Caller back.voidCaller gone.voidConfigurable run.voidcustomizeSocket(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 intgetPort()Gets the port.Gets the remote host.Gets the remote ip.ecmwf.common.plugin.ServerPlugin.ServerPluginDescriptorGets the server plugin descriptor.Gets the socket.Invoke.booleanChecks if is available.abstract ThreadService.ConfigurableRunnableGet instance of current class.abstract voidrefuseConnection(Socket socket, int connectionsCount) Refuse connection.voidreleaseConnection(Socket socket, boolean close) Release connection.voidsetCloseOnExit(boolean close) Sets the close on exit.booleanstart()Start.abstract voidstartConnection(Socket socket) Start connection.voidstop()Stop.Methods inherited from class ecmwf.common.plugin.PluginThread
getCaller, getParam, getPluginContainer, getPluginName, getRef, getVersion, handle, handle, setAttribute, setCaller, setPluginContainer, subscribe, unSubscribeMethods 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:
configurableRunin classPluginThread
-
addConnection
Adds the connection.- Parameters:
socket- the socketinfo- the info
-
callerBack
public void callerBack(boolean reset) Caller back. Caller back.- Overrides:
callerBackin 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:
startin 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:
getAttributein interfaceMBeanService- Overrides:
getAttributein 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:
getMBeanInfoin interfaceMBeanService- Overrides:
getMBeanInfoin 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:
invokein interfaceMBeanService- Overrides:
invokein classPluginThread- Parameters:
operationName- the operation nameparams- the paramssignature- the signature- Returns:
- the object
- Throws:
NoSuchMethodException- the no such method exceptionMBeanException- the MBean exception
-