[JBoss-dev] CVS update: jboss/src/main/org/jboss/jmx/connector ConnectorFactoryImpl.java

2002-01-02 Thread Jason Dillon

  User: user57  
  Date: 02/01/02 20:00:58

  Modified:src/main/org/jboss/jmx/connector ConnectorFactoryImpl.java
  Log:
   o migrated all components to a new JMX domain name model.  jboss.system
 is now where to core/spine components live.  moved all components that
 were in JBOSS-SYSTEM that did not move into a jboss.* domain into
 jboss (where the server is now registered).  The point was to limit the
 members of jboss.system to core bits only.
   o Created org.jboss.system.Server, which does the work of initialization
 that org.jboss.Main used to do.  Main now only parses the command line,
 sets up basic legecy properties and creates a Server instance.
   o Moved functionality of Shutdown (component not cl tool) into Server (
 which is bound as jboss.system:service=Server)
   o Moved more Runtime access from Info into Server.  Exposed memory info
 as attributes.
   o Logging a WARN everywhere that uses System.getProperty(jboss.system.home)
 as that should go away soon/eventually.
   o Initialized the invokerMap in the harmi impl to avoid NPE
   o Made getopt.jar a member of the lib/* dir instead of adding it to the
 run.jar and shutdown.jars each time.
   o Minor cosmetic changes along the way.
  
  Revision  ChangesPath
  1.5   +12 -11jboss/src/main/org/jboss/jmx/connector/ConnectorFactoryImpl.java
  
  Index: ConnectorFactoryImpl.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/jmx/connector/ConnectorFactoryImpl.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ConnectorFactoryImpl.java 2001/10/11 01:41:59 1.4
  +++ ConnectorFactoryImpl.java 2002/01/03 04:00:58 1.5
  @@ -1,9 +1,10 @@
   /*
  -* JBoss, the OpenSource J2EE webOS
  -*
  -* Distributable under LGPL license.
  -* See terms of license at gnu.org.
  -*/
  + * JBoss, the OpenSource J2EE webOS
  + *
  + * Distributable under LGPL license.
  + * See terms of license at gnu.org.
  + */
  +
   package org.jboss.jmx.connector;
   
   import java.util.Arrays;
  @@ -37,8 +38,8 @@
* @authorA href=mailto:[EMAIL PROTECTED];Andreas Schaefer/A
* @created   May 2, 2001
**/
  -public class ConnectorFactoryImpl {
  -
  +public class ConnectorFactoryImpl
  +{
  // Constants -
   
  // Static 
  @@ -139,7 +140,7 @@
   );
   mServer.registerMBean(
  lConnector,
  -   new ObjectName( JBOSS-SYSTEM:name=RMIConnectorTo + 
pConnector.getServer() )
  +   new ObjectName( jboss:name=RMIConnectorTo + pConnector.getServer() 
)
   );
}
catch( Exception e ) {
  @@ -156,7 +157,7 @@
   );
   mServer.registerMBean(
  lConnector,
  -   new ObjectName( JBOSS-SYSTEM:name=EJBConnectorTo + 
pConnector.getServer() )
  +   new ObjectName( jboss:name=EJBConnectorTo + pConnector.getServer() 
)
   );
}
catch( Exception e ) {
  @@ -177,7 +178,7 @@
 try {
if( pConnector.getProtocol().equals( rmi ) ) {
   Set lConnectors = mServer.queryMBeans(
  -   new ObjectName( JBOSS-SYSTEM:name=RMIConnectorTo + 
pConnector.getServer() ),
  +   new ObjectName( jboss:name=RMIConnectorTo + pConnector.getServer() 
),
  null
   );
   if( !lConnectors.isEmpty() ) {
  @@ -198,7 +199,7 @@
}
else if( pConnector.getProtocol().equals( ejb ) ) {
   Set lConnectors = mServer.queryMBeans(
  -   new ObjectName( JBOSS-SYSTEM:name=EJBConnectorTo + 
pConnector.getServer() ),
  +   new ObjectName( jboss:name=EJBConnectorTo + pConnector.getServer() 
),
  null
   );
   if( !lConnectors.isEmpty() ) {
  
  
  

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jboss/src/main/org/jboss/jmx/connector ConnectorFactoryImpl.java ConnectorFactoryService.java ConnectorFactoryServiceMBean.java JMXConnector.java JMXConnectorMBean.java

2001-09-11 Thread Mad

  User: schaefera
  Date: 01/09/11 18:49:06

  Added:   src/main/org/jboss/jmx/connector ConnectorFactoryImpl.java
ConnectorFactoryService.java
ConnectorFactoryServiceMBean.java JMXConnector.java
JMXConnectorMBean.java
  Log:
  Repackaged the JMX Connector and Adaptor for JBoss. I also added
  a new EJB-Adaptor and EJB-Connector. The adaptor allows a secured
  access to a local/remote JMX Server and the EJB-Connector makes
  this transparent for any Java client.
  
  Revision  ChangesPath
  1.1  jboss/src/main/org/jboss/jmx/connector/ConnectorFactoryImpl.java
  
  Index: ConnectorFactoryImpl.java
  ===
  /*
  * JBoss, the OpenSource J2EE webOS
  *
  * Distributable under LGPL license.
  * See terms of license at gnu.org.
  */
  package org.jboss.jmx.connector;
  
  import java.util.Arrays;
  import java.util.Collection;
  import java.util.Hashtable;
  import java.util.Iterator;
  import java.util.Set;
  import java.util.StringTokenizer;
  import java.util.Vector;
  
  import javax.management.DynamicMBean;
  import javax.management.MBeanServer;
  import javax.management.ObjectInstance;
  import javax.management.ObjectName;
  
  import javax.naming.InitialContext;
  import javax.naming.NameClassPair;
  import javax.naming.NamingEnumeration;
  
  import org.jboss.jmx.connector.JMXConnector;
  import org.jboss.jmx.connector.rmi.RMIClientConnectorImpl;
  
  /**
   * Factory delivering a list of servers and its available protocol connectors
   * and after selected to initiate the connection This is just the (incomplete)
   * interface of it
   *
   *@authorA href=mailto:[EMAIL PROTECTED];Andreas
   *  quot;Madquot; Schaefer/A
   *@created   May 2, 2001
   **/
  public class ConnectorFactoryImpl {
  
 // Constants -
  
 // Static 
  
 // Attributes 
  
 private MBeanServer mServer;
  
  
 // Public 
  
 public ConnectorFactoryImpl(
MBeanServer pServer
 ) {
mServer = pServer;
 }
  
 /**
  * Look up for all registered JMX Connector at a given JNDI server
  *
  * @param pProperties List of properties defining the JNDI server
  * @param pTester Connector Tester implementation to be used
  *
  * @return An iterator on the list of ConnectorNames representing
  * the found JMX Connectors
  **/
 public Iterator getConnectors( Hashtable pProperties, IConnectorTester pTester ) {
Vector lConnectors = new Vector();
try {
   InitialContext lNamingServer = new InitialContext( pProperties );
   // Lookup the JNDI server
   NamingEnumeration enum = lNamingServer.list(  );
   while( enum.hasMore() ) {
  NameClassPair lItem = ( NameClassPair ) enum.next();
  ConnectorName lName = pTester.check( lItem.getName(), lItem.getClass() );
  if( lName != null ) {
 lConnectors.add( lName );
  }
   }
}
catch( Exception e ) {
   e.printStackTrace();
}
  
return lConnectors.iterator();
 }
  
 /**
  * Initiate a connection to the given server with the given protocol
  *
  * @param pConnector Connector Name used to identify the remote JMX Connector
  *
  * @return JMX Connector or null if server or protocol is not supported
  **/
 public JMXConnector createConnection(
ConnectorName pConnector
 ) {
JMXConnector lConnector = null;
// At the moment only RMI protocol is supported (on the client side)
if( pConnector.getProtocol().equals( rmi ) ) {
   try {
  lConnector = new RMIClientConnectorImpl(
 pConnector.getServer()
  );
  mServer.registerMBean(
 lConnector,
 new ObjectName( JBOSS-SYSTEM:name=RMIConnectorTo + 
pConnector.getServer() )
  );
   }
   catch( Exception e ) {
  e.printStackTrace();
   }
}
return lConnector;
 }
  
 /**
  * Removes the given connection and frees the resources
  *
  * @param pConnector Connector Name used to identify the remote JMX Connector
  **/
 public void removeConnection(
ConnectorName pConnector
 ) {
if( pConnector.getProtocol().equals( rmi ) ) {
   try {
  Set lConnectors = mServer.queryMBeans(
 new ObjectName( JBOSS-SYSTEM:name=RMIConnectorTo + 
pConnector.getServer() ),
 null
  );
  if( !lConnectors.isEmpty() ) {