Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

org.objectweb.cjdbc.controller.jmx.RmiConnector Class Reference

List of all members.

Public Member Functions

 RmiConnector (String controllerName, String hostName, int port, JMXAuthenticator authenticator, SSLConfiguration sslConfig) throws JmxException
JMXAuthenticator getAuthenticator ()
void setAuthenticator (JMXAuthenticator authenticator)
int getPort ()
void setPort (int port)
SSLConfiguration getSslConfig ()
void setSslConfig (SSLConfiguration sslConfig)
JMXConnectorServer getConnection ()
void start () throws JmxException
void stop () throws JmxException
String getControllerName ()
String getHostName ()
synchronized void sendNotification (AbstractStandardMBean mbean, String type, String priority, String description, Hashtable data)

Static Public Member Functions

List getRmiConnectors ()
void broadcastNotification (AbstractStandardMBean mbean, String type, String priority, String description, Hashtable data)

Static Package Attributes

Trace logger

Detailed Description

This class defines a RmiConnector

Author:
Marc Wick
Version:
1.0

Definition at line 60 of file RmiConnector.java.


Constructor & Destructor Documentation

org.objectweb.cjdbc.controller.jmx.RmiConnector.RmiConnector String  controllerName,
String  hostName,
int  port,
JMXAuthenticator  authenticator,
SSLConfiguration  sslConfig
throws JmxException
 

Creates a new RmiConnector.java object

Parameters:
controllerName for reference when sending notification
hostName the name of the host we bind to, if null the default InetAddress.getLocalHost().getHostName() is used
port the port the rmi registry is listening on
authenticator the jmxauthenticator used for the connection
sslConfig ssl configuration
Exceptions:
JmxException the name of the localhost could not be determined

TODO: dssmith - determine applicability of getLocalHost()

Definition at line 92 of file RmiConnector.java.

00095   {
00096     if (hostName != null)
00097     {
00098       this.hostName = hostName;
00099     }
00100     else
00101     {
00102       try
00103       {
00104         /** TODO: dssmith - determine applicability of getLocalHost() */
00105         this.hostName = InetAddress.getLocalHost().getHostName();
00106       }
00107       catch (UnknownHostException ex)
00108       {
00109         throw new JmxException(ex);
00110       }
00111     }
00112     this.controllerName = controllerName;
00113     this.port = port;
00114     this.authenticator = authenticator;
00115     this.sslConfig = sslConfig;
00116 
00117     addRmiConnector(this);
00118   }


Member Function Documentation

void org.objectweb.cjdbc.controller.jmx.RmiConnector.broadcastNotification AbstractStandardMBean  mbean,
String  type,
String  priority,
String  description,
Hashtable  data
[static]
 

Broadcast a jmx notification to any client connected to any RmiConnector registered in the static list. The method is static because it is sending notifications to all rmi connectors.

Parameters:
mbean the mbean that is generating the notification
type the type as seen in CjdbcNotificationList
priority notification level as seen in CjdbcNotificationList
description a string description of the notification
data a hashtable of data that can be used to give more information on the notification

Definition at line 388 of file RmiConnector.java.

References org.objectweb.cjdbc.controller.jmx.RmiConnector.sendNotification().

00390   {
00391     sequence++;
00392     logger.info("Sending notification:" + description + "(Message No:"
00393         + sequence + ")");
00394     Iterator iter = rmiConnectors.iterator();
00395     RmiConnector rmi;
00396     while (iter.hasNext())
00397     {
00398       rmi = ((RmiConnector) iter.next());
00399       rmi.sendNotification(mbean, type, priority, description, data);
00400     }
00401   }

JMXAuthenticator org.objectweb.cjdbc.controller.jmx.RmiConnector.getAuthenticator  ) 
 

Returns the authenticator value.

Returns:
Returns the authenticator.

Definition at line 125 of file RmiConnector.java.

00126   {
00127     return authenticator;
00128   }

JMXConnectorServer org.objectweb.cjdbc.controller.jmx.RmiConnector.getConnection  ) 
 

Returns the connection value.

Returns:
Returns the connection.

Definition at line 185 of file RmiConnector.java.

00186   {
00187     return connection;
00188   }

String org.objectweb.cjdbc.controller.jmx.RmiConnector.getControllerName  ) 
 

Returns:
Returns the controllerName.

Definition at line 324 of file RmiConnector.java.

00325   {
00326     return controllerName;
00327   }

String org.objectweb.cjdbc.controller.jmx.RmiConnector.getHostName  ) 
 

Returns:
Returns the hostName.

Definition at line 332 of file RmiConnector.java.

Referenced by org.objectweb.cjdbc.controller.core.Controller.getJmxName(), and org.objectweb.cjdbc.controller.virtualdatabase.protocol.VirtualDatabaseConfiguration.VirtualDatabaseConfiguration().

00333   {
00334     return hostName;
00335   }

int org.objectweb.cjdbc.controller.jmx.RmiConnector.getPort  ) 
 

Returns the port value.

Returns:
Returns the port.

Definition at line 145 of file RmiConnector.java.

Referenced by org.objectweb.cjdbc.controller.core.Controller.getJmxName(), and org.objectweb.cjdbc.controller.virtualdatabase.protocol.VirtualDatabaseConfiguration.VirtualDatabaseConfiguration().

00146   {
00147     return port;
00148   }

List org.objectweb.cjdbc.controller.jmx.RmiConnector.getRmiConnectors  )  [static]
 

Returns a list of rmiConnectors .

Returns:
Returns list of RmiConnector.

Definition at line 306 of file RmiConnector.java.

00307   {
00308     return rmiConnectors;
00309   }

SSLConfiguration org.objectweb.cjdbc.controller.jmx.RmiConnector.getSslConfig  ) 
 

Returns the sslConfig value.

Returns:
Returns the sslConfig.

Definition at line 165 of file RmiConnector.java.

00166   {
00167     return sslConfig;
00168   }

synchronized void org.objectweb.cjdbc.controller.jmx.RmiConnector.sendNotification AbstractStandardMBean  mbean,
String  type,
String  priority,
String  description,
Hashtable  data
 

This method sends notification to all client registered to an instance of the RmiConnector class. The JmxNotification class is used here to create an object with all the information gathered in parameters, and then is serialized in xml for interaction on the client side.

See also:
JmxNotification
Parameters:
mbean the mbean that is generating the notification
type the type as seen in CjdbcNotificationList
priority notification level as seen in CjdbcNotificationList
description a string description of the notification
data a hashtable of data that can be used to give more information on the notification

Definition at line 359 of file RmiConnector.java.

References org.objectweb.cjdbc.controller.jmx.AbstractStandardMBean.sendNotification().

Referenced by org.objectweb.cjdbc.controller.jmx.RmiConnector.broadcastNotification().

00361   {
00362 
00363     myDate = new Date();
00364     time = myDate.getTime();
00365 
00366     cjdbcNotification = new JmxNotification(priority, "" + sequence, type,
00367         description, "" + time, controllerName, mbean.getClass().getName(),
00368         "mbeanName", hostName, "" + port, data);
00369     notification = new Notification(type, mbean, sequence, myDate.getTime(),
00370         description);
00371     notification.setUserData(cjdbcNotification.toString());
00372     mbean.sendNotification(notification);
00373   }

void org.objectweb.cjdbc.controller.jmx.RmiConnector.setAuthenticator JMXAuthenticator  authenticator  ) 
 

Sets the authenticator value.

Parameters:
authenticator The authenticator to set.

Definition at line 135 of file RmiConnector.java.

00136   {
00137     this.authenticator = authenticator;
00138   }

void org.objectweb.cjdbc.controller.jmx.RmiConnector.setPort int  port  ) 
 

Sets the port value.

Parameters:
port The port to set.

Definition at line 155 of file RmiConnector.java.

00156   {
00157     this.port = port;
00158   }

void org.objectweb.cjdbc.controller.jmx.RmiConnector.setSslConfig SSLConfiguration  sslConfig  ) 
 

Sets the sslConfig value.

Parameters:
sslConfig The sslConfig to set.

Definition at line 175 of file RmiConnector.java.

00176   {
00177     this.sslConfig = sslConfig;
00178   }

void org.objectweb.cjdbc.controller.jmx.RmiConnector.start  )  throws JmxException
 

start the rmi connector and the rmi naming service

Exceptions:
JmxException an exception

Definition at line 195 of file RmiConnector.java.

Referenced by org.objectweb.cjdbc.controller.core.ControllerFactory.setUpJmx().

00196   {
00197     createNamingService();
00198     createJRMPAdaptor();
00199   }

void org.objectweb.cjdbc.controller.jmx.RmiConnector.stop  )  throws JmxException
 

stop the rmi connector and the rmi registry

Exceptions:
JmxException an exception

Definition at line 206 of file RmiConnector.java.

Referenced by org.objectweb.cjdbc.controller.jmx.MBeanServerManager.setJmxEnabled().

00207   {
00208     try
00209     {
00210       if (connection != null)
00211         connection.stop();
00212       if (rmiRegistry != null)
00213         UnicastRemoteObject.unexportObject(rmiRegistry, true);
00214     }
00215     catch (Exception e)
00216     {
00217       throw new JmxException(e);
00218     }
00219     finally
00220     {
00221       connection = null;
00222       rmiRegistry = null;
00223     }
00224   }


Member Data Documentation

Trace org.objectweb.cjdbc.controller.jmx.RmiConnector.logger [static, package]
 

Initial value:

 Trace
                                               .getLogger("org.objectweb.cjdbc.controller.jmx")

Definition at line 62 of file RmiConnector.java.


The documentation for this class was generated from the following file:
Generated on Mon Apr 11 22:03:52 2005 for C-JDBC by  doxygen 1.3.9.1