public class JythonRunner extends java.lang.Object implements JythonRunnerMBean, javax.management.NotificationListener, javax.management.MBeanRegistration
| Constructor and Description |
|---|
JythonRunner() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
getCacheScript()
Returns whether the script should be kept in the cache.
|
java.lang.String |
getNotificationType()
Gets the specific notification type being listened
|
javax.management.ObjectName |
getObservedObject()
Gets the object being observed by this MBean
|
static PythonInterpreter |
getPythonInterpreter() |
java.lang.String |
getScript()
Returns the script as text.
|
java.net.URL |
getScriptURL()
Returns the URL pointing to the script source
|
boolean |
getUseText()
Indicates wether to use the script given in the ScripText variable or
the one given in the script File.
|
void |
handleNotification(javax.management.Notification notification,
java.lang.Object handback)
Called when a notification occurs.
|
protected static java.lang.String |
loadStream(java.io.InputStream in) |
void |
postDeregister()
Callback called just after the MBean has been successfully unregistered.
|
void |
postRegister(java.lang.Boolean registrationDone)
Callback called just after the MBean has been registered (successfully or not).
|
void |
preDeregister()
Callback called just before MBean unregistration from the MBeanServer.
|
javax.management.ObjectName |
preRegister(javax.management.MBeanServer server,
javax.management.ObjectName name)
Gathers some basic data
|
protected void |
registerListener() |
void |
runScript()
Executes a given script.
|
void |
setCacheScript(boolean useCache)
Sets whether the script should be kept in the cache.
|
void |
setNotificationType(java.lang.String notificationName)
Sets the notification being listed.
|
void |
setObservedObject(javax.management.ObjectName targetMBeanName)
Sets the object being observed by this MBean.
|
void |
setScript(java.lang.String text)
Sets the content of the script.
|
void |
setScriptURL(java.net.URL file)
Sets the script source as URL.
|
protected void |
unregisterListener() |
public void handleNotification(javax.management.Notification notification,
java.lang.Object handback)
javax.management.NotificationListenerhandleNotification in interface javax.management.NotificationListenernotification - The notification objecthandback - Helps in associating information regarding the listener.public void runScript()
runScript in interface JythonRunnerMBeanpublic static PythonInterpreter getPythonInterpreter()
protected static java.lang.String loadStream(java.io.InputStream in)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getNotificationType()
getNotificationType in interface JythonRunnerMBeanpublic void setNotificationType(java.lang.String notificationName)
setNotificationType in interface JythonRunnerMBeanpublic void setObservedObject(javax.management.ObjectName targetMBeanName)
setObservedObject in interface JythonRunnerMBeanpublic javax.management.ObjectName getObservedObject()
getObservedObject in interface JythonRunnerMBeanpublic boolean getUseText()
getUseText in interface JythonRunnerMBeanpublic void setScript(java.lang.String text)
setScript in interface JythonRunnerMBeanpublic java.lang.String getScript()
getScript in interface JythonRunnerMBeanpublic java.net.URL getScriptURL()
getScriptURL in interface JythonRunnerMBeanpublic void setScriptURL(java.net.URL file)
setScriptURL in interface JythonRunnerMBeanpublic boolean getCacheScript()
getCacheScript in interface JythonRunnerMBeanpublic void setCacheScript(boolean useCache)
setCacheScript in interface JythonRunnerMBeanpublic javax.management.ObjectName preRegister(javax.management.MBeanServer server,
javax.management.ObjectName name)
throws java.lang.Exception
preRegister in interface javax.management.MBeanRegistrationserver - The MBeanServer on which the MBean will be registered.name - The ObjectName of the MBean.ObjectName of the registered MBean, must not be nulljava.lang.Exception - Any possible exception generated by this method will be caught
by the MBeanServer and re-thrown as an MBeanRegistrationException
to the client.public void postRegister(java.lang.Boolean registrationDone)
javax.management.MBeanRegistrationpostRegister in interface javax.management.MBeanRegistrationregistrationDone - True if the registration was successful, false otherwise.public void preDeregister()
throws java.lang.Exception
javax.management.MBeanRegistrationpreDeregister in interface javax.management.MBeanRegistrationjava.lang.Exception - Any possible exception generated by this method will be caught
by the MBeanServer and re-thrown as an MBeanRegistrationException
to the client.public void postDeregister()
javax.management.MBeanRegistrationpostDeregister in interface javax.management.MBeanRegistrationprotected void registerListener()
protected void unregisterListener()