[JBoss-dev] CVS update: jboss/src/main/org/jboss/deployment/scope J2eeGlobalScopeDeployer.java

2001-06-26 Thread schaefera

  User: schaefera
  Date: 01/06/26 12:00:26

  Modified:src/main/org/jboss/deployment/scope
J2eeGlobalScopeDeployer.java
  Log:
  Fixed what I screwed up and brought version 1.7 back in (Sorry).
  
  Revision  ChangesPath
  1.9   +497 -0
jboss/src/main/org/jboss/deployment/scope/J2eeGlobalScopeDeployer.java
  
  Index: J2eeGlobalScopeDeployer.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/deployment/scope/J2eeGlobalScopeDeployer.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- J2eeGlobalScopeDeployer.java  2001/06/16 05:53:38 1.8
  +++ J2eeGlobalScopeDeployer.java  2001/06/26 19:00:26 1.9
  @@ -0,0 +1,497 @@
  +/*
  + * JBoss, the OpenSource EJB server
  + *
  + * Distributable under LGPL license.
  + * See terms of license at gnu.org.
  + */
  +
  +package org.jboss.deployment.scope;
  +
  +import org.jboss.deployment.Deployment;
  +import org.jboss.mgt.Application;
  +import org.jboss.deployment.J2eeDeploymentException;
  +import java.net.URL;
  +import java.net.MalformedURLException;
  +import java.net.URLClassLoader;
  +import java.util.Iterator;
  +import java.util.List;
  +import java.util.Collection;
  +import java.util.Set;
  +import java.util.Map;
  +import java.io.IOException;
  +import javax.management.ObjectName;
  +import javax.management.MBeanException;
  +import javax.management.RuntimeMBeanException;
  +import javax.management.RuntimeErrorException;
  +import javax.management.JMException;
  +
  +
  +/**
  + * This is a deployer that introduces a J2ee application scoping facility and
  + * proper (re-)deployment procedures. It implements a default global scope.
  + * @author  cgjung
  + * @version 0.9
  + */
  +
  +public class J2eeGlobalScopeDeployer extends org.jboss.deployment.J2eeDeployer {
  +
  +/** the scopes that are in effect */
  +final protected Map scopes=new java.util.HashMap();
  +
  +/** Creates new J2eeDependencyDeployer */
  +public J2eeGlobalScopeDeployer() {
  +}
  +
  +/** registers a new scope in this deployer
  + * @param name unique name of the new scope
  + *
  + * @param scope the scope to register
  + * @return the scope that has been isolated by that action
  + *
  + */
  +public Scope registerScope(String name, Scope scope) {
  +synchronized(scopes) {
  +return (Scope) scopes.put(name,scope);
  +}
  +}
  +
  +/** looks up a scope
  + * @param name the unique name of the scope
  + *
  + * @return the registered scope
  + *
  + */
  +public Scope getScope(String name) {
  +synchronized(scopes) {
  +return (Scope) scopes.get(name);
  +}
  +}
  +
  +/** deregisters a scope
  + * @param name unique name of the scope to deRegister
  + * @return the deRegistered scope
  + *
  + */
  +public Scope deRegisterScope(String name) {
  +synchronized(scopes) {
  +return (Scope) scopes.remove(name);
  +}
  +}
  +
  +/** static name of the global scope */
  +final public static String GLOBAL_SCOPE="GLOBAL_SCOPE";
  +
  +/** starts the service by first creating
  + * a new scope
  + * @throws Exception to indicate
  + * that either superclass or scope creation
  + * went wrong.
  + */
  +public void startService() throws Exception {
  +registerScope(GLOBAL_SCOPE,createScope());
  +super.startService();
  +}
  +
  +/** factory method to create a new scope, May throw a general exception
  + * if this very basic enterprise fails.
  + * @throws Exception May throw any exception to indicate
  + * instantiation problems of the scope (probably
  + * because initial meta-data could not be found,
  + * is corrupt, etc.)
  + * @return a freshly instantiated and preconfigured scope.
  + *
  + */
  +protected Scope createScope() throws Exception {
  +return new Scope(log);
  +}
  +
  +/** stops the service by freeing
  + * scope afterwards
  + */
  +public void stopService() {
  +super.stopService();
  +deRegisterScope(GLOBAL_SCOPE);
  +}
  +
  +
  +/**
  + * creates an application class loader for this deployment
  + * this class loader will be shared between jboss and
  + * tomcat via the contextclassloader
  + * we include all ejb and web-modules at this level
  + * to also be able to connect flat ejb-jars to each other
  + * @param scope the scope in which to create the classloader
  + * @param deployment the deployment that is about to be made,
  + * but is already installed
  + * @throws J2eeDeploymentException to indicate
  + * problems with instantiating the classloader
  +   

[JBoss-dev] CVS update: jboss/src/main/org/jboss/jmx/server XMLAdaptor.dtd XMLAdaptorImpl.java XMLTestService.java

2001-06-25 Thread schaefera

  User: schaefera
  Date: 01/06/25 22:29:13

  Modified:src/main/org/jboss/jmx/server XMLAdaptorImpl.java
XMLTestService.java
  Added:   src/main/org/jboss/jmx/server XMLAdaptor.dtd
  Log:
  Added all the major methods to the XML Adaptor which make sense. I also
  added a DTD for the XML file but it is only Alpha release.
  
  Revision  ChangesPath
  1.3   +236 -52   jboss/src/main/org/jboss/jmx/server/XMLAdaptorImpl.java
  
  Index: XMLAdaptorImpl.java
  ===
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/jmx/server/XMLAdaptorImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XMLAdaptorImpl.java   2001/06/25 18:28:52 1.2
  +++ XMLAdaptorImpl.java   2001/06/26 05:29:13 1.3
  @@ -16,30 +16,27 @@
   import javax.management.AttributeList;
   import javax.management.ObjectName;
   import javax.management.ObjectInstance;
  -// import javax.management.AttributeNotFoundException;
  -// import javax.management.InstanceNotFoundException;
  -// import javax.management.InvalidAttributeValueException;
   import javax.management.MalformedObjectNameException;
   import javax.management.MBeanAttributeInfo;
  +import javax.management.MBeanInfo;
   import javax.management.MBeanException;
   import javax.management.MBeanServer;
  -// import javax.management.ReflectionException;
   import javax.naming.InitialContext;
   
   import org.w3c.dom.Document;
   import org.w3c.dom.Element;
   import org.w3c.dom.Node;
   import org.w3c.dom.NodeList;
  +import org.w3c.dom.Text;
   
   /**
   * XML Adaptor Implementation interpreting the XML wrapped JMX commands.
   *
   * @author Andreas Schaefer ([EMAIL PROTECTED])
   * @created June 22, 2001
  -* @version $Revision: 1.2 $
  +* @version $Revision: 1.3 $
   */
  -public class XMLAdaptorImpl
  -{
  +public class XMLAdaptorImpl {
 // Constants -
   
 // Attributes 
  @@ -77,6 +74,17 @@
   
 // Public 
   
  +  /**
  +  * Performs a set of calls to the MBean Server and returns
  +  * it return values.
  +  *
  +  * @param pJmxOperations Complete XML Document (compliant to the
  +  *   XMLAdaptor.dtd) containing a list of calls
  +  *   to the MBean Server.
  +  *
  +  * @return List of return values, one for each call. If the call doesn't
  +  * have a return value of the operation failed it will be null.
  +  **/
 public Object[] invokeXML( Document pJmxOperations ) {
   Vector lReturns = new Vector();
   NodeList lRoot = pJmxOperations.getChildNodes();
  @@ -92,6 +100,15 @@
   return (Object[]) lReturns.toArray( new Object[ 0 ] );
 }
   
  +  /**
  +  * Performs a single call to the MBean Server and return its return value
  +  *
  +  * @param pJmxOperation Second level element (compliant to XMLAdaptor.dtd)
  +  *  representing one call to the MBean Server
  +  *
  +  * @return Return value of the call or null if call failed or doesn't have
  +  * a return value.
  +  **/
 public Object invokeXML( Element pJmxOperation ) {
   if( pJmxOperation == null ) {
 return null;
  @@ -99,63 +116,96 @@
   // Get the requested operation
   String lTag = pJmxOperation.getTagName();
   System.out.println( "XMLAdaptorImpl.invokeXML(), Tag: " + lTag );
  -if( "invoke".equals( lTag ) ) {
  +if( "create-mbean".equals( lTag ) ) {
  +  return createMBean(
  +pJmxOperation.getAttribute( "code" ),
  +getObjectName(
  +  pJmxOperation.getAttribute( "name" ),
  +  pJmxOperation.getElementsByTagName( "object-name" )
  +),
  +pJmxOperation.getElementsByTagName( "constructor" ),
  +pJmxOperation.getElementsByTagName( "attribute" )
  +  );
  +}
  +else if( "invoke".equals( lTag ) ) {
 // Get the operation, Object Name and attributes and invoke it
 String lOperation = pJmxOperation.getAttribute( "operation" );
 return invoke(
   lOperation,
  -pJmxOperation.getElementsByTagName( "object-name" ),
  +getObjectName( pJmxOperation.getElementsByTagName( "object-name" ) ),
   pJmxOperation.getElementsByTagName( "attribute" )
 );
   }
  -else if( !"create-mbean".equals( lTag ) ) {
  -NodeList lList = pJmxOperation.getElementsByTagName( "object-name" );
  -  // Get the operation, Object Name and attributes and invoke it
  -  String lCodebase = pJmxOperation.getAttribute( "code" );
  -  String lNam

[JBoss-dev] CVS update: jboss/src/main/org/jboss/jmx/server XMLAdaptorImpl.java XMLTestService.java

2001-06-25 Thread schaefera

  User: schaefera
  Date: 01/06/25 11:28:52

  Modified:src/main/org/jboss/jmx/server XMLAdaptorImpl.java
XMLTestService.java
  Log:
  Fixed some problems and add the "create-mbean" support.
  
  Revision  ChangesPath
  1.2   +267 -68   jboss/src/main/org/jboss/jmx/server/XMLAdaptorImpl.java
  
  Index: XMLAdaptorImpl.java
  ===
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/jmx/server/XMLAdaptorImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XMLAdaptorImpl.java   2001/06/23 08:48:42 1.1
  +++ XMLAdaptorImpl.java   2001/06/25 18:28:52 1.2
  @@ -6,19 +6,24 @@
   */
   package org.jboss.jmx.server;
   
  +import java.beans.PropertyEditor;
  +import java.beans.PropertyEditorManager;
  +import java.util.Hashtable;
   import java.util.Iterator;
   import java.util.Vector;
   
   import javax.management.Attribute;
  +import javax.management.AttributeList;
   import javax.management.ObjectName;
  -import javax.management.QueryExp;
   import javax.management.ObjectInstance;
  -import javax.management.AttributeNotFoundException;
  -import javax.management.InstanceNotFoundException;
  -import javax.management.InvalidAttributeValueException;
  +// import javax.management.AttributeNotFoundException;
  +// import javax.management.InstanceNotFoundException;
  +// import javax.management.InvalidAttributeValueException;
  +import javax.management.MalformedObjectNameException;
  +import javax.management.MBeanAttributeInfo;
   import javax.management.MBeanException;
  -import javax.management.ReflectionException;
   import javax.management.MBeanServer;
  +// import javax.management.ReflectionException;
   import javax.naming.InitialContext;
   
   import org.w3c.dom.Document;
  @@ -31,7 +36,7 @@
   *
   * @author Andreas Schaefer ([EMAIL PROTECTED])
   * @created June 22, 2001
  -* @version $Revision: 1.1 $
  +* @version $Revision: 1.2 $
   */
   public class XMLAdaptorImpl
   {
  @@ -43,7 +48,22 @@
   
 // Static 
   
  -  // Constructors --
  +  /** Primitive type name -> class map. */
  +  private static Hashtable mPrimitives = new Hashtable();
  +  
  +  /** Setup the primitives map. */
  +  static {
  +mPrimitives.put( "boolean", Boolean.TYPE );
  +mPrimitives.put( "byte", Byte.TYPE );
  +mPrimitives.put( "short", Short.TYPE );
  +mPrimitives.put( "int", Integer.TYPE );
  +mPrimitives.put( "long", Long.TYPE );
  +mPrimitives.put( "float", Float.TYPE );
  +mPrimitives.put( "double", Double.TYPE );
  +mPrimitives.put( "char", Character.TYPE );
  +  }
  +
  +   // Constructors --
   
 /**
 *  Constructor for the JMXAdaptorImpl object
  @@ -59,10 +79,15 @@
   
 public Object[] invokeXML( Document pJmxOperations ) {
   Vector lReturns = new Vector();
  -NodeList lOperations = pJmxOperations.getChildNodes();
  -for( int i = 0; i < lOperations.getLength(); i++ ) {
  -  Element lChildElement = (Element) lOperations.item( i );
  -  lReturns.add( invokeXML( lChildElement ) );
  +NodeList lRoot = pJmxOperations.getChildNodes();
  +if( lRoot.getLength() > 0 ) {
  +  Element lRootElement = (Element) lRoot.item( 0 );
  +  System.out.println( "XMLAdaptorImpl.invokeXML(), root: " + lRootElement );
  +  NodeList lOperations = lRootElement.getChildNodes();
  +  for( int i = 0; i < lOperations.getLength(); i++ ) {
  +Element lChildElement = (Element) lOperations.item( i );
  +lReturns.add( invokeXML( lChildElement ) );
  +  }
   }
   return (Object[]) lReturns.toArray( new Object[ 0 ] );
 }
  @@ -73,74 +98,248 @@
   }
   // Get the requested operation
   String lTag = pJmxOperation.getTagName();
  +System.out.println( "XMLAdaptorImpl.invokeXML(), Tag: " + lTag );
   if( "invoke".equals( lTag ) ) {
 // Get the operation, Object Name and attributes and invoke it
 String lOperation = pJmxOperation.getAttribute( "operation" );
  -  if( !"".equals( lOperation ) ) {
  +  return invoke(
  +lOperation,
  +pJmxOperation.getElementsByTagName( "object-name" ),
  +pJmxOperation.getElementsByTagName( "attribute" )
  +  );
  +}
  +else if( !"create-mbean".equals( lTag ) ) {
   NodeList lList = pJmxOperation.getElementsByTagName( "object-name" );
  -if( lList.getLength() > 0 ) {
  -  try {
  -Node lNodeName = lList.item( 0 );
  -ObjectName lName = null;
  -switch( lNodeName.ge

[JBoss-dev] CVS update: jboss/src/main/org/jboss/jmx/server XMLAdaptorImpl.java XMLAdaptorService.java XMLAdaptorServiceMBean.java XMLTestService.java XMLTestServiceMBean.java

2001-06-23 Thread schaefera

  User: schaefera
  Date: 01/06/23 01:48:42

  Added:   src/main/org/jboss/jmx/server XMLAdaptorImpl.java
XMLAdaptorService.java XMLAdaptorServiceMBean.java
XMLTestService.java XMLTestServiceMBean.java
  Log:
  First draft for the XML Adaptor. Only invoke is supported. Have a look
  at XMLTestService to see how to use it.
  
  Revision  ChangesPath
  1.1  jboss/src/main/org/jboss/jmx/server/XMLAdaptorImpl.java
  
  Index: XMLAdaptorImpl.java
  ===
  /*
  * JBoss, the OpenSource EJB server
  *
  * Distributable under LGPL license.
  * See terms of license at gnu.org.
  */
  package org.jboss.jmx.server;
  
  import java.util.Iterator;
  import java.util.Vector;
  
  import javax.management.Attribute;
  import javax.management.ObjectName;
  import javax.management.QueryExp;
  import javax.management.ObjectInstance;
  import javax.management.AttributeNotFoundException;
  import javax.management.InstanceNotFoundException;
  import javax.management.InvalidAttributeValueException;
  import javax.management.MBeanException;
  import javax.management.ReflectionException;
  import javax.management.MBeanServer;
  import javax.naming.InitialContext;
  
  import org.w3c.dom.Document;
  import org.w3c.dom.Element;
  import org.w3c.dom.Node;
  import org.w3c.dom.NodeList;
  
  /**
  * XML Adaptor Implementation interpreting the XML wrapped JMX commands.
  *
  * @author Andreas Schaefer ([EMAIL PROTECTED])
  * @created June 22, 2001
  * @version $Revision: 1.1 $
  */
  public class XMLAdaptorImpl
  {
// Constants -
  
// Attributes 
MBeanServer mServer;
  
  
// Static 
  
// Constructors --
  
/**
*  Constructor for the JMXAdaptorImpl object
*
*@param pServer MBeanServer this adaptor executes its calls on
*/
public XMLAdaptorImpl( MBeanServer pServer ) {
  super();
  mServer = pServer;
}
  
// Public 
  
public Object[] invokeXML( Document pJmxOperations ) {
  Vector lReturns = new Vector();
  NodeList lOperations = pJmxOperations.getChildNodes();
  for( int i = 0; i < lOperations.getLength(); i++ ) {
Element lChildElement = (Element) lOperations.item( i );
lReturns.add( invokeXML( lChildElement ) );
  }
  return (Object[]) lReturns.toArray( new Object[ 0 ] );
}
  
public Object invokeXML( Element pJmxOperation ) {
  if( pJmxOperation == null ) {
return null;
  }
  // Get the requested operation
  String lTag = pJmxOperation.getTagName();
  if( "invoke".equals( lTag ) ) {
// Get the operation, Object Name and attributes and invoke it
String lOperation = pJmxOperation.getAttribute( "operation" );
if( !"".equals( lOperation ) ) {
  NodeList lList = pJmxOperation.getElementsByTagName( "object-name" );
  if( lList.getLength() > 0 ) {
try {
  Node lNodeName = lList.item( 0 );
  ObjectName lName = null;
  switch( lNodeName.getNodeType() ) {
case Node.ELEMENT_NODE:
  Element lElementName = (Element) lNodeName;
  lName = new ObjectName( lElementName.getAttribute( "name" ) );
  break;
  }
  // Get attribute values and types
  NodeList lAttributeList = pJmxOperation.getElementsByTagName( 
"attribute" );
  Object[] lObjects = new Object[ lAttributeList.getLength() ];
  String[] lTypes = new String[ lAttributeList.getLength() ];
  for( int i = 0; i < lAttributeList.getLength(); i++ ) {
Node lAttributeNode = lAttributeList.item( i );
Element lAttributeElement = (Element) lAttributeNode;
lTypes[ i ] = lAttributeElement.getAttribute( "type" );
if( "int".equals( lTypes[ i ] ) ) {
  lObjects[ i ] = new Integer( lAttributeElement.getAttribute( "value" 
) );
}
else if( "short".equals( lTypes[ i ] ) ) {
  lObjects[ i ] = new Short( lAttributeElement.getAttribute( "value" ) 
);
}
else if( "byte".equals( lTypes[ i ] ) ) {
  lObjects[ i ] = new Byte( lAttributeElement.getAttribute( "value" ) 
);
}
else if( "char".equals( lTypes[ i ] ) ) {
  lObjects[ i ] = new Character( lAttributeElement.getAttribute( 
"value" ).charAt

[JBoss-dev] CVS update: manual/src/docs howtotimer.xml

2001-06-18 Thread schaefera

  User: schaefera
  Date: 01/06/18 14:07:42

  Modified:src/docs howtotimer.xml
  Log:
  Some small fixes like the lookup of the MBeanServer.
  
  Revision  ChangesPath
  1.6   +9 -5  manual/src/docs/howtotimer.xml
  
  Index: howtotimer.xml
  ===
  RCS file: /cvsroot/jboss/manual/src/docs/howtotimer.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- howtotimer.xml2001/05/31 05:47:33 1.5
  +++ howtotimer.xml2001/06/18 21:07:42 1.6
  @@ -27,12 +27,16 @@
  Main.java class). This mbean tag looks like this:
   
  +   ]]>
  +   Keep in mind that there will be no notification about the startup. 
To check use the JMX
  +   HTML-Adaptor on port 8082 by default. The timer is loaded from the 
jmxri.jar file in /lib
  +   directory.

   
   
   
  -   If you are not using JBoss then to the following: 
  +   If you are not using JBoss then to the following (which means that 
you want to use a timer
  +   outside of JBoss (maybe on the client or administration side): 

 

  @@ -75,11 +79,11 @@
  This is quite simple if your are in a MBean registered to the same 
JMX server because
  then you get it when you overwrite preRegister() method. 
  When you are in the same JVM as the JMX server (in JBoss is any 
instance running
  -   within JBoss like EJBs or other classes). Then you can obtain the 
MBeanServer throug:
  +   within JBoss like EJBs or other classes). Then you can obtain the 
MBeanServer through:
 
   
  MBeanServer lServer =
  -  MBeanServerFactory.createMBeanServer();
  +  (MBeanServer) MBeanServerFactory.findMBeanServer( null ).get( 0 );
   
   
  For the rest it is a little bit more complicated. In a Java client 
you can use JBoss RMI
  @@ -183,7 +187,7 @@
"I call you with this timer once",
// No user object
null,
  - // I one minute from now
  + // In one minute from now
lNext,
Timer.ONE_MINUTE,
10
  
  
  

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



[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb Application.java ContainerFactory.java

2001-06-15 Thread schaefera

  User: schaefera
  Date: 01/06/15 22:53:38

  Modified:src/main/org/jboss/ejb Application.java
ContainerFactory.java
  Log:
  Added the support for classes with a single string as only argument for
  the constructor to the ConfigurationService. Some fixes and additional
  methods for the JBoss management.
  
  Revision  ChangesPath
  1.11  +2 -1  jboss/src/main/org/jboss/ejb/Application.java
  
  Index: Application.java
  ===
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/Application.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Application.java  2001/06/03 20:59:40 1.10
  +++ Application.java  2001/06/16 05:53:38 1.11
  @@ -10,6 +10,7 @@
   import java.util.Iterator;
   import java.util.Collection;
   import java.util.HashMap;
  +import java.util.Hashtable;
   
   import javax.ejb.EJBLocalHome;
   
  @@ -22,7 +23,7 @@
*   @see Container
*   @see ContainerFactory
*   @author Rickard Öberg ([EMAIL PROTECTED])
  - *   @version $Revision: 1.10 $
  + *   @version $Revision: 1.11 $
*/
   public class Application
implements Service
  
  
  
  1.77  +49 -57jboss/src/main/org/jboss/ejb/ContainerFactory.java
  
  Index: ContainerFactory.java
  ===
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/ContainerFactory.java,v
  retrieving revision 1.76
  retrieving revision 1.77
  diff -u -r1.76 -r1.77
  --- ContainerFactory.java 2001/06/14 23:44:31 1.76
  +++ ContainerFactory.java 2001/06/16 05:53:38 1.77
  @@ -23,6 +23,7 @@
   import java.util.Properties;
   import java.util.Iterator;
   import java.util.HashMap;
  +import java.util.Hashtable;
   import java.util.ArrayList;
   import java.util.StringTokenizer;
   import java.util.jar.JarFile;
  @@ -56,8 +57,6 @@
   import org.jboss.metadata.ConfigurationMetaData;
   import org.jboss.metadata.XmlLoadable;
   import org.jboss.metadata.XmlFileLoader;
  -import org.jboss.mgt.EJB;
  -import org.jboss.mgt.Module;
   import org.jboss.security.EJBSecurityManager;
   import org.jboss.security.RealmMapping;
   import org.jboss.util.MBeanProxy;
  @@ -82,7 +81,7 @@
   *   @author Peter Antman ([EMAIL PROTECTED])
   *   @author Scott Stark([EMAIL PROTECTED])
   *
  -*   @version $Revision: 1.76 $
  +*   @version $Revision: 1.77 $
   */
   public class ContainerFactory
 extends org.jboss.util.ServiceMBeanSupport
  @@ -369,6 +368,11 @@
 app.init();
 // Start application
 app.start();
  +  // Startup the Management MBean Wrapper for the containers
  +  Iterator i = app.containers.values().iterator();
  +  while( i.hasNext() ) {
  + handleContainerManagement( (Container) i.next(), true );
  +  }
   
 // Add to webserver so client can access classes through dynamic class 
downloading
 WebServiceMBean webServer = (WebServiceMBean) MBeanProxy.create( 
WebServiceMBean.class, WebServiceMBean.OBJECT_NAME );
  @@ -401,6 +405,20 @@
 {
 Log.unsetLog();
 }
  +  // Inform the Data Collector that new/old EJBs were deployed
  +  try
  +{
  +getServer().invoke(
  +  new ObjectName( "Management", "service", "Collector" ),
  +  "refresh",
  +  new Object[] {},
  +  new String[] {}
  +);
  +}
  +  catch( Exception e )
  +{
  +e.printStackTrace();
  +}
   }
   
 private void deploy( Application app, URL url, ClassLoader cl )
  @@ -470,20 +488,6 @@
   log.log( "Deploying " + bean.getEjbName() );
   app.addContainer( createContainer( bean, cl, localCl ) );
   }
  -  // Inform the Data Collector that new/old EJBs were deployed
  -  try
  -{
  -getServer().invoke(
  -  new ObjectName( "Management", "service", "Collector" ),
  -  "refresh",
  -  new Object[] {},
  -  new String[] {}
  -);
  -}
  -  catch( Exception e )
  -{
  -e.printStackTrace();
  -}
   }
   
 /**
  @@ -508,28 +512,13 @@
   // Undeploy application
   Log.setLog( log );
   log.log( "Undeploying:" + url );
  +// Shutdown the Management MBean Wrapper for the containers
  +Iterator i = app.containers.values().iterator();
  +while( i.hasNext() ) {
  +   handleContainerManagement( (Container) i.next(), false );
  +}
   app.stop();
   app.destroy();
  -try
  -   {
  -   // Remove EJBs management data
  -   getServer().invoke(
  -  new ObjectName( "Management", "service", "Collector" ),
  -  "removeModule",
  -  new Obje

[JBoss-dev] CVS update: jboss/src/main/org/jboss/naming JNDIView.java JNDIViewMBean.java

2001-06-15 Thread schaefera

  User: schaefera
  Date: 01/06/15 22:53:38

  Modified:src/main/org/jboss/naming JNDIView.java JNDIViewMBean.java
  Log:
  Added the support for classes with a single string as only argument for
  the constructor to the ConfigurationService. Some fixes and additional
  methods for the JBoss management.
  
  Revision  ChangesPath
  1.4   +253 -1jboss/src/main/org/jboss/naming/JNDIView.java
  
  Index: JNDIView.java
  ===
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/naming/JNDIView.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JNDIView.java 2001/04/09 07:02:18 1.3
  +++ JNDIView.java 2001/06/16 05:53:38 1.4
  @@ -37,7 +37,7 @@
   
   @author [EMAIL PROTECTED]
   @author Vladimir Blagojevic <[EMAIL PROTECTED]>
  -@version $Revision: 1.3 $
  +@version $Revision: 1.4 $
   */
   public class JNDIView extends ServiceMBeanSupport implements JNDIViewMBean
   {
  @@ -156,6 +156,146 @@
   return buffer.toString();
   }
   
  +/**
  + * List deployed application java:comp namespaces, the java:
  + * namespace as well as the global InitialContext JNDI namespace in a
  + * XML Format.
  + *
  + * @param verbose, if true, list the class of each object in addition to its 
name
  + **/
  +public String listXML() {
  +StringBuffer buffer = new StringBuffer();
  +Iterator applications = null;
  +Context context = null;
  +ClassLoader currentLoader = Thread.currentThread().getContextClassLoader();
  +
  +/* Get all deployed applications so that we can list their
  +   java: namespaces which are ClassLoader local
  +*/
  +try
  +{
  +applications = (Iterator) server.invoke(
  +new ObjectName(ContainerFactoryMBean.OBJECT_NAME),
  +"getDeployedApplications",
  +new Object[] { },
  +new String[] { });
  +}
  +catch(Exception e)
  +{
  +log.exception(e);
  +buffer.append( "" );
  +buffer.append( "" );
  +buffer.append( '\n' );
  +buffer.append( "" + "Failed to getDeployedApplications " + 
e.toString() + "" );
  +buffer.append( '\n' );
  +buffer.append( "" );
  +buffer.append( '\n' );
  +buffer.append( "" );
  +buffer.append( '\n' );
  +return buffer.toString();
  +}
  +
  +buffer.append( "" );
  +buffer.append( '\n' );
  +// List each application JNDI namespace
  +while(applications.hasNext())
  +{
  +Application app = (Application) applications.next();
  +Iterator iter = app.getContainers().iterator();
  +buffer.append( "" );
  +buffer.append( '\n' );
  +buffer.append( "" + app.getName() + "" );
  +buffer.append( '\n' );
  +while(iter.hasNext())
  +{
  +Container con = (Container)iter.next();
  +/* Set the thread class loader to that of the container as
  +   the class loader is used by the java: context object
  +   factory to partition the container namespaces.
  +*/
  +Thread.currentThread().setContextClassLoader(con.getClassLoader());
  +String bean = con.getBeanMetaData().getEjbName();
  +buffer.append( "" );
  +buffer.append( '\n' );
  +buffer.append( "java:comp" );
  +buffer.append( '\n' );
  +buffer.append( "" + bean + "" 
);
  +buffer.append( '\n' );
  +try
  +{
  + context = new InitialContext();
  +context = (Context)context.lookup("java:comp");
  +}
  +catch(NamingException e)
  +{
  +buffer.append( "" );
  +buffer.append( '\n' );
  +buffer.append( "" + "Failed on lookup, " + e.toString( 
true ) + "" );
  +buffer.append( '\n' );
  +buffer.append( "" );
  +buffer.append( '\n' );
  +continue;
  +}
  +listXML( context, buffer );
  +buffer.append( "" );
  +buffer.append( '\n' );
  +}
  +buffer.app

[JBoss-dev] CVS update: jboss/src/main/org/jboss/configuration ConfigurationService.java

2001-06-15 Thread schaefera

  User: schaefera
  Date: 01/06/15 22:53:38

  Modified:src/main/org/jboss/configuration ConfigurationService.java
  Log:
  Added the support for classes with a single string as only argument for
  the constructor to the ConfigurationService. Some fixes and additional
  methods for the JBoss management.
  
  Revision  ChangesPath
  1.30  +31 -1 jboss/src/main/org/jboss/configuration/ConfigurationService.java
  
  Index: ConfigurationService.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/configuration/ConfigurationService.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- ConfigurationService.java 2001/06/10 07:49:09 1.29
  +++ ConfigurationService.java 2001/06/16 05:53:38 1.30
  @@ -9,6 +9,7 @@
   
   import java.io.*;
   import java.beans.*;
  +import java.lang.reflect.Constructor;
   import java.lang.reflect.InvocationHandler;
   import java.lang.reflect.Method;
   import java.lang.reflect.Modifier;
  @@ -45,7 +46,7 @@
* @author  Rickard Öberg ([EMAIL PROTECTED])
* @author  [EMAIL PROTECTED]
* @author  Jason Dillon mailto:[EMAIL PROTECTED]";><[EMAIL PROTECTED]>
  - * @version $Revision: 1.29 $
  + * @version $Revision: 1.30 $
*/
   public class ConfigurationService
   extends ServiceMBeanSupport
  @@ -405,6 +406,9 @@
   /**
* Provides a wrapper around the information about which constructor
* that MBeanServer should use to construct a MBean.
  + * Please note that only basic datatypes (type is then the same as
  + * you use to declare it "short", "int", "float" etc.) and any class
  + * having a constructor taking a single "String" as only parameter.
*
* XML syntax for contructor:
*   
  @@ -467,6 +471,10 @@
   String value = arg.getAttribute("value");
   Object realValue = value;
   if( signature != null ) {
  +   if( signature.equals( "short" ) ) {
  +  signature = Short.TYPE.getName();
  +  realValue = new Short( value );
  +   } else
  if( signature.equals( "int" ) ) {
 signature = Integer.TYPE.getName();
 realValue = new Integer( value );
  @@ -495,6 +503,22 @@
 signature = Boolean.TYPE.getName();
 realValue = new Boolean( value );
  }
  +   else
  +   {
  +  try {
  + // Check if there is a constructor with a single 
String as
  + // only parameter
  + Class signatureClass =
  +
Thread.currentThread().getContextClassLoader().loadClass( signature );
  + Constructor signatureConstructor =
  +signatureClass.getConstructor( new Class[] { 
String.class } );
  + realValue = signatureConstructor.newInstance(
  +new Object[] { value }
  + );
  +  }
  +  catch( Exception e ) {
  +  }
  +   }
   }
   info.signature[j] = signature;
   info.params[j] = realValue;
  @@ -817,3 +841,9 @@
   }
   }
   }
  +
  +/* Log
  +6/13/2001 Andreas Schaefer Added type "short" for constructor argument and
  +   any class having a constructor taking a "String"
  +   as only parameter
  +*/
  
  
  

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



[JBoss-dev] CVS update: jboss/src/main/org/jboss/deployment J2eeDeployer.java

2001-06-15 Thread schaefera

  User: schaefera
  Date: 01/06/15 22:53:38

  Modified:src/main/org/jboss/deployment J2eeDeployer.java
  Log:
  Added the support for classes with a single string as only argument for
  the constructor to the ConfigurationService. Some fixes and additional
  methods for the JBoss management.
  
  Revision  ChangesPath
  1.31  +1 -4  jboss/src/main/org/jboss/deployment/J2eeDeployer.java
  
  Index: J2eeDeployer.java
  ===
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/deployment/J2eeDeployer.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- J2eeDeployer.java 2001/06/04 22:55:12 1.30
  +++ J2eeDeployer.java 2001/06/16 05:53:38 1.31
  @@ -41,9 +41,6 @@
   import javax.management.RuntimeMBeanException;
   import javax.management.RuntimeErrorException;
   
  -import org.jboss.mgt.Application;
  -import org.jboss.mgt.Module;
  -import org.jboss.mgt.ServerDataCollector;
   import org.jboss.logging.Log;
   import org.jboss.util.MBeanProxy;
   import org.jboss.util.ServiceMBeanSupport;
  @@ -71,7 +68,7 @@
   *   @author mailto:[EMAIL PROTECTED]";>Daniel Schulze
   *   @author Toby Allsopp ([EMAIL PROTECTED])
   *   @author [EMAIL PROTECTED]
  -*   @version $Revision: 1.30 $
  +*   @version $Revision: 1.31 $
   */
   public class J2eeDeployer 
   extends ServiceMBeanSupport
  
  
  

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



[JBoss-dev] CVS update: jboss/src/main/org/jboss/deployment/scope J2eeGlobalScopeDeployer.java

2001-06-15 Thread schaefera

  User: schaefera
  Date: 01/06/15 22:53:38

  Modified:src/main/org/jboss/deployment/scope
J2eeGlobalScopeDeployer.java
  Log:
  Added the support for classes with a single string as only argument for
  the constructor to the ConfigurationService. Some fixes and additional
  methods for the JBoss management.
  
  Revision  ChangesPath
  1.8   +0 -497
jboss/src/main/org/jboss/deployment/scope/J2eeGlobalScopeDeployer.java
  
<>
  
  

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



[JBoss-dev] CVS update: jboss/src/lib jboss-management.jar

2001-06-15 Thread schaefera

  User: schaefera
  Date: 01/06/15 22:52:01

  Added:   src/lib  jboss-management.jar
  Log:
  Archive containing the management classes.
  
  Revision  ChangesPath
  1.1  jboss/src/lib/jboss-management.jar
  
<>
  
  

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



[JBoss-dev] CVS update: jboss/src/etc/conf/default jboss.jcml

2001-06-15 Thread schaefera

  User: schaefera
  Date: 01/06/15 22:51:24

  Modified:src/etc/conf/default jboss.jcml
  Log:
  
  
  Revision  ChangesPath
  1.40  +1 -1  jboss/src/etc/conf/default/jboss.jcml
  
  Index: jboss.jcml
  ===
  RCS file: /cvsroot/jboss/jboss/src/etc/conf/default/jboss.jcml,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- jboss.jcml2001/06/14 23:39:09 1.39
  +++ jboss.jcml2001/06/16 05:51:24 1.40
  @@ -138,7 +138,7 @@
 
 
 
  -  
  +  
   5000
 
   
  
  
  

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



[JBoss-dev] CVS update: jboss/src/main/org/jboss/mgt Application.java ContainerMgt.java ContainerMgtMBean.java EJB.java Item.java Module.java ServerDataCollector.java ServerDataCollectorMBean.java Servlet.java

2001-06-15 Thread schaefera

  User: schaefera
  Date: 01/06/15 22:49:52

  Removed: src/main/org/jboss/mgt Application.java ContainerMgt.java
ContainerMgtMBean.java EJB.java Item.java
Module.java ServerDataCollector.java
ServerDataCollectorMBean.java Servlet.java
  Log:
  This directory is not used anymore because the name should not be a
  abbreviation.

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



[JBoss-dev] CVS update: jboss/src/main/org/jboss/management ContainerManagement.java ContainerManagementMBean.java DataCollector.java EJBDataCollector.java JDBCDataCollector.java JNDIDataCollector.java MailDataCollector.java NodeDataCollector.java ServerDataCollector.java ServerDataCollectorMBean.java

2001-06-15 Thread schaefera

  User: schaefera
  Date: 01/06/15 22:48:44

  Added:   src/main/org/jboss/management ContainerManagement.java
ContainerManagementMBean.java DataCollector.java
EJBDataCollector.java JDBCDataCollector.java
JNDIDataCollector.java MailDataCollector.java
NodeDataCollector.java ServerDataCollector.java
ServerDataCollectorMBean.java
  Log:
  Renamed the short directory to "mgt" and the add the new design how to
  collect the data. The DataCollector is the interface which has to be
  used by any class collecting management interface (mapping the JBoss
  data to the management understandable data).
  
  Revision  ChangesPath
  1.1  jboss/src/main/org/jboss/management/ContainerManagement.java
  
  Index: ContainerManagement.java
  ===
  /*
  * JBoss, the OpenSource EJB server
  *
  * Distributable under LGPL license.
  * See terms of license at gnu.org.
  */
  package org.jboss.management;
  
  /*
  import java.beans.Beans;
  import java.beans.beancontext.BeanContextServicesSupport;
  import java.net.URL;
  import java.net.URLClassLoader;
  import java.net.MalformedURLException;
  import java.io.File;
  import java.io.InputStream;
  import java.io.FileInputStream;
  import java.io.FileOutputStream;
  import java.io.IOException;
  import java.rmi.RemoteException;
  import java.rmi.ServerException;
  import java.rmi.server.UnicastRemoteObject;
  import java.util.Properties;
  import java.util.Iterator;
  import java.util.HashMap;
  import java.util.ArrayList;
  import java.util.StringTokenizer;
  import java.util.jar.JarFile;
  import java.util.jar.Manifest;
  import java.util.jar.Attributes;
  */
  
  import javax.naming.Context;
  import javax.naming.InitialContext;
  import javax.naming.Name;
  import javax.naming.NameNotFoundException;
  import javax.naming.NamingException;
  import javax.management.MBeanServer;
  import javax.management.MBeanRegistration;
  import javax.management.ObjectName;
  import javax.transaction.TransactionManager;
  
  import org.jboss.ejb.Container;
  
  import org.jboss.logging.Log;
  import org.jboss.logging.ConsoleLogging;
  import org.jboss.logging.ConsoleLoggingMBean;
  
  import org.jboss.metadata.ApplicationMetaData;
  import org.jboss.metadata.BeanMetaData;
  import org.jboss.metadata.SessionMetaData;
  import org.jboss.metadata.EntityMetaData;
  import org.jboss.metadata.MessageDrivenMetaData;
  import org.jboss.metadata.ConfigurationMetaData;
  import org.jboss.metadata.XmlLoadable;
  import org.jboss.metadata.XmlFileLoader;
  import org.jboss.logging.Logger;
  
  /**
  *   A ContainerMgt is used as the long arm of a deployed EJB's container.
  *
  *   @see Container
  *   @author Andreas Schaefer ([EMAIL PROTECTED])
  *
  *   @version $Revision: 1.1 $
  */
  public class ContainerManagement
extends org.jboss.util.ServiceMBeanSupport
implements ContainerManagementMBean
  {
 // Attributes 
 // Container this is the management proxy for
 Container mContainer = null;
 // The logger of this service
 Log mLog = Log.createLog( getName() );
 ObjectName mName = null;
  
 // Constructor ---
  
 public ContainerManagement( Container pContainer ) {
setContainer( pContainer );
 }
 
 // Public 
  
 private void setContainer( Container pContainer ) {
mContainer = pContainer;
 }
 
 public Container getContainer() {
return mContainer;
 }
 
 /**
 * Implements the abstract getObjectName() method in superclass
 * to return this service's name.
 *
 * @param   server
 * @param   name
 *
 * @exception MalformedObjectNameException
 * @return
 */
 public ObjectName getObjectName( MBeanServer server, ObjectName name )
throws javax.management.MalformedObjectNameException
 {
mName = name;
return name;
 }
 
 /**
 * Implements the abstract getName() method in superclass to
 * return the name of this object.
 *
 * @return 'Container factory'
 */
 public String getName() {
return "Container Management Proxy";
 }
 
 /**
 * Implements the template method in superclass. This method stops all the
 * applications in this server.
 */
 public void stopService() {
 }
 
 /**
 * Implements the template method in superclass. This method destroys all
 * the applications in this server and clears the deployments list.
 */
 public void destroyService() {
 }
 
  }
  
  
  
  1.1  
jboss/src/main/org/jboss/management/

[JBoss-dev] CVS update: jboss/src/etc/conf/default jboss.jcml

2001-06-10 Thread schaefera

  User: schaefera
  Date: 01/06/10 23:38:19

  Modified:src/etc/conf/default jboss.jcml
  Log:
  Adjusted the constructor parameter for the SchedulableExample to show how
  to use the constructor parameters.
  
  Revision  ChangesPath
  1.38  +4 -4  jboss/src/etc/conf/default/jboss.jcml
  
  Index: jboss.jcml
  ===
  RCS file: /cvsroot/jboss/jboss/src/etc/conf/default/jboss.jcml,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- jboss.jcml2001/06/10 07:47:47 1.37
  +++ jboss.jcml2001/06/11 06:38:19 1.38
  @@ -420,19 +420,19 @@
 
 
 
  -  
  +  
   
 
 
  
  
  

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



[JBoss-dev] CVS update: jboss/src/main/org/jboss/util Schedulable.java Scheduler.java SchedulerMBean.java

2001-06-10 Thread schaefera

  User: schaefera
  Date: 01/06/10 23:32:31

  Modified:src/main/org/jboss/util Schedulable.java Scheduler.java
SchedulerMBean.java
  Log:
  Adjusted the Scheduler to run as a real MBean able to be started,
  managed and stopped at runtime (JMX HTML-Adaptor) etc.
  
  Revision  ChangesPath
  1.2   +1 -1  jboss/src/main/org/jboss/util/Schedulable.java
  
  Index: Schedulable.java
  ===
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/util/Schedulable.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Schedulable.java  2001/06/10 07:50:58 1.1
  +++ Schedulable.java  2001/06/11 06:32:31 1.2
  @@ -35,6 +35,6 @@
   **/
  public void perform(
 Date pTimeOfCall,
  -  int pRemainingRepetitions
  +  long pRemainingRepetitions
  );
   }
  
  
  
  1.4   +279 -81   jboss/src/main/org/jboss/util/Scheduler.java
  
  Index: Scheduler.java
  ===
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/util/Scheduler.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Scheduler.java2001/06/11 00:52:23 1.3
  +++ Scheduler.java2001/06/11 06:32:31 1.4
  @@ -14,6 +14,8 @@
   import java.util.Hashtable;
   import java.util.Iterator;
   import java.util.Map;
  +import java.util.StringTokenizer;
  +import java.util.Vector;
   
   import javax.management.MalformedObjectNameException;
   import javax.management.MBeanServer;
  @@ -54,24 +56,28 @@
  // Members
  // -  
   
  -   private MBeanServer mServer;
  private String mName;
  
  -   private long mSchedulePeriod;
  -   private int mRemainingRepetitions = 0;
  +   private long mActualSchedulePeriod;
  +   private long mRemainingRepetitions = 0;
  private int mActualSchedule = -1;
  -   private boolean mScheduleIsStarted = false;
  -   private boolean mWaitForNextCallToStop = false;
  private ObjectName mTimer;
  private Schedulable mSchedulable;
  
  +   private boolean mScheduleIsStarted = false;
  +   private boolean mWaitForNextCallToStop = false;
  private boolean mStartOnStart = false;
  -   private String mSchedulableClass;
  -   private Object[] mInitArguments;
  -   private String[] mInitTypes;
  +   private boolean mIsRestartPending = true;
  +
  +   // Pending values which can be different to the actual ones
  +   private Class mSchedulableClass;
  +   private String mSchedulableArguments;
  +   private String[] mSchedulableArgumentList = new String[ 0 ];
  +   private String mSchedulableArgumentTypes;
  +   private Class[] mSchedulableArgumentTypeList = new Class[ 0 ];
  private Date mStartDate;
  -   private long mPeriod;
  -   private int mRepetitions;
  +   private long mSchedulePeriod;
  +   private long mInitialRepetitions;
   
  // -
  // Constructors
  @@ -111,53 +117,86 @@
  ) {
 mName = pName;
 mStartOnStart = true;
  -  mSchedulableClass = pSchedulableClass;
  -//  if( pInitArguments == null || pInitArguments.equals( "" ) ) {
  - mInitArguments = new Object[ 0 ];
  -//  }
  -//  if( pInitTypes == null || pInitTypes.equals( "" ) ) {
  - mInitArguments = new String[ 0 ];
  -//  }
  +  setSchedulableClass( pSchedulableClass );
  +  setSchedulableArguments( pInitArguments );
  +  setSchedulableArgumentTypes( pInitTypes );
 mStartDate = new Date( pInitialStartDate );
  -  mPeriod = pSchedulePeriod;
  -  mRepetitions = (int) pNumberOfRepetitions;
  +  setSchedulePeriod( pSchedulePeriod );
  +  setInitialRepetitions( pNumberOfRepetitions );
  }
   
  // -
  // SchedulerMBean Methods
  // -  
  
  -   public void startSchedule(
  -  String pSchedulableClass,
  -  Object[] pInitArguments,
  -  String[] pInitTypes,
  -  Date pInitialStartDate,
  -  long pSchedulePeriod,
  -  int pNumberOfRepetitions
  -   ) {
  +   public void startSchedule() {
 // Check if not already started
 if( !isStarted() ) {
try {
  -// Try to load the Schedulable Class
  -Class lSchedulableClass = 
Thread.currentThread().getContextClassLoader().loadClass( pSchedulableClass );
  -// Create an instance of it
  -if( pInitArguments == null ) {
  -   pInitArguments = new Object[ 0 ];
  -}
  -if( pInitTypes == null ) {
  -   pInitTypes = new String[ 0 ];
  -}
  -if( p

[JBoss-dev] CVS update: jboss/src/main/org/jboss/util Scheduler.java

2001-06-10 Thread schaefera

  User: schaefera
  Date: 01/06/10 17:52:23

  Modified:src/main/org/jboss/util Scheduler.java
  Log:
  Accidentely I cleared this file.
  
  Revision  ChangesPath
  1.3   +521 -0jboss/src/main/org/jboss/util/Scheduler.java
  
  Index: Scheduler.java
  ===
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/util/Scheduler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Scheduler.java2001/06/10 18:40:21 1.2
  +++ Scheduler.java2001/06/11 00:52:23 1.3
  @@ -0,0 +1,521 @@
  +/*
  + * JBoss, the OpenSource EJB server
  + *
  + * Distributable under LGPL license.
  + * See terms of license at gnu.org.
  + */
  +package org.jboss.util;
  +
  +import java.lang.reflect.Constructor;
  +import java.security.InvalidParameterException;
  +import java.util.ArrayList;
  +import java.util.Collection;
  +import java.util.Date;
  +import java.util.Hashtable;
  +import java.util.Iterator;
  +import java.util.Map;
  +
  +import javax.management.MalformedObjectNameException;
  +import javax.management.MBeanServer;
  +import javax.management.Notification;
  +import javax.management.NotificationListener;
  +import javax.management.ObjectName;
  +import javax.naming.Context;
  +import javax.naming.InitialContext;
  +import javax.naming.Name;
  +import javax.naming.NamingException;
  +import javax.naming.NameNotFoundException;
  +import javax.naming.Reference;
  +import javax.naming.StringRefAddr;
  +
  +import org.jboss.logging.Log;
  +import org.jboss.naming.NonSerializableFactory;
  +import org.jboss.util.ServiceMBeanSupport;
  +
  +/**
  + * Scheduler Instance to allow clients to run this as a
  + * scheduling service for any Schedulable instances.
  + *
  + * @author Andreas Schaefer ([EMAIL PROTECTED])
  + **/
  +public class Scheduler
  +   extends ServiceMBeanSupport
  +   implements SchedulerMBean
  +{
  +
  +   // -
  +   // Constants
  +   // -  
  +
  +   public static String JNDI_NAME = "scheduler:domain";
  +   public static String JMX_NAME = "scheduler";
  +
  +   // -
  +   // Members
  +   // -  
  +
  +   private MBeanServer mServer;
  +   private String mName;
  +   
  +   private long mSchedulePeriod;
  +   private int mRemainingRepetitions = 0;
  +   private int mActualSchedule = -1;
  +   private boolean mScheduleIsStarted = false;
  +   private boolean mWaitForNextCallToStop = false;
  +   private ObjectName mTimer;
  +   private Schedulable mSchedulable;
  +   
  +   private boolean mStartOnStart = false;
  +   private String mSchedulableClass;
  +   private Object[] mInitArguments;
  +   private String[] mInitTypes;
  +   private Date mStartDate;
  +   private long mPeriod;
  +   private int mRepetitions;
  +
  +   // -
  +   // Constructors
  +   // -  
  +
  +   /**
  +* Default (no-args) Constructor
  +**/
  +   public Scheduler()
  +   {
  +  mName = null;
  +   }
  +
  +   /**
  +* Constructor with the necessary attributes to be set
  +*
  +* @param pName Name of the MBean
  +**/
  +   public Scheduler( String pName )
  +   {
  +  mName = pName;
  +   }
  +
  +   /**
  +* Constructor with the necessary attributes to be set
  +*
  +* @param pName Name of the MBean
  +**/
  +   public Scheduler(
  +  String pName,
  +  String pSchedulableClass,
  +  String pInitArguments,
  +  String pInitTypes,
  +  long pInitialStartDate,
  +  long pSchedulePeriod,
  +  long pNumberOfRepetitions
  +   ) {
  +  mName = pName;
  +  mStartOnStart = true;
  +  mSchedulableClass = pSchedulableClass;
  +//  if( pInitArguments == null || pInitArguments.equals( "" ) ) {
  + mInitArguments = new Object[ 0 ];
  +//  }
  +//  if( pInitTypes == null || pInitTypes.equals( "" ) ) {
  + mInitArguments = new String[ 0 ];
  +//  }
  +  mStartDate = new Date( pInitialStartDate );
  +  mPeriod = pSchedulePeriod;
  +  mRepetitions = (int) pNumberOfRepetitions;
  +   }
  +
  +   // -
  +   // SchedulerMBean Methods
  +   // -  
  +   
  +   public void startSchedule(
  +  String pSchedulableClass,
  +  Object[] pInitArguments,
  +  String[] pInitTypes,
  +  Date pInitialStartDate,
  +  long pSchedulePeriod,
  +  int pNumberOfRepetitions
  

[JBoss-dev] CVS update: jboss/src/main/org/jboss/util ServiceMBeanSupport.java

2001-06-10 Thread schaefera

  User: schaefera
  Date: 01/06/10 17:40:26

  Modified:src/main/org/jboss/util ServiceMBeanSupport.java
  Log:
  Added a fix when the MBeanServer returns "false" to postRegister() then
  the ServiceMBean will call destroy() which needs an instance of Log but
  this is not created until init() is called.
  Now the postRegister() will check if the Log instance is there and if not
  create one.
  
  Revision  ChangesPath
  1.13  +10 -2 jboss/src/main/org/jboss/util/ServiceMBeanSupport.java
  
  Index: ServiceMBeanSupport.java
  ===
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/util/ServiceMBeanSupport.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- ServiceMBeanSupport.java  2001/04/24 23:25:11 1.12
  +++ ServiceMBeanSupport.java  2001/06/11 00:40:26 1.13
  @@ -30,7 +30,7 @@
   
   @author Rickard Öberg ([EMAIL PROTECTED])
   @author [EMAIL PROTECTED]
  -@version $Revision: 1.12 $
  +@version $Revision: 1.13 $
   */
   public abstract class ServiceMBeanSupport
  extends NotificationBroadcasterSupport
  @@ -172,8 +172,16 @@
   
  public void postRegister(java.lang.Boolean registrationDone)
  {
  -  if (!registrationDone.booleanValue())
  +  if (!registrationDone.booleanValue()) {
  + if( category == null ) {
  +category = Category.getInstance(getName());
  + }
  + if( log == null ) {
  +log = new LogToCategory(category);
  + }
  + log.log( "Registration is not done -> destroy" );
destroy();
  +  }
  }
  
  public void preDeregister()
  
  
  

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



[JBoss-dev] CVS update: jboss/src/main/org/jboss/util Scheduler.java

2001-06-10 Thread schaefera

  User: schaefera
  Date: 01/06/10 11:40:21

  Modified:src/main/org/jboss/util Scheduler.java
  Log:
  Fixed a problem with a wrong import.
  
  Revision  ChangesPath
  1.2   +0 -523jboss/src/main/org/jboss/util/Scheduler.java
  
<>
  
  

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



[JBoss-dev] CVS update: jboss/src/main/org/jboss/util Schedulable.java Scheduler.java SchedulerMBean.java

2001-06-10 Thread schaefera

  User: schaefera
  Date: 01/06/10 00:50:58

  Added:   src/main/org/jboss/util Schedulable.java Scheduler.java
SchedulerMBean.java
  Log:
  Added a Scheduler Service for JBoss to let run a Task at a given date/time
  for a given number (also unlimited) of repeats.
  
  Revision  ChangesPath
  1.1  jboss/src/main/org/jboss/util/Schedulable.java
  
  Index: Schedulable.java
  ===
  /*
   * JBoss, the OpenSource EJB server
   *
   * Distributable under LGPL license.
   * See terms of license at gnu.org.
   */
  package org.jboss.util;
  
  import java.util.Date;
  
  /**
   * This interface defines the manageable interface for a Scheduler Service
   * allowing the client to create a Schedulable instance which is then run
   * by this service at given times.
   *
   * @author Andreas Schaefer ([EMAIL PROTECTED])
   **/
  public interface Schedulable
  {
 // -
 // Constants
 // -  
  
 // -
 // Methods
 // -
  
 /**
  * This method is called from the Scheduler Service
  *
  * @param pTimeOfCall Date/Time of the scheduled call
  * @param pRemainingRepetitions Number of the remaining repetitions which
  *  is -1 if there is an unlimited number of
  *  repetitions.
  **/
 public void perform(
Date pTimeOfCall,
int pRemainingRepetitions
 );
  }
  
  
  
  1.1  jboss/src/main/org/jboss/util/Scheduler.java
  
  Index: Scheduler.java
  ===
  /*
   * JBoss, the OpenSource EJB server
   *
   * Distributable under LGPL license.
   * See terms of license at gnu.org.
   */
  package org.jboss.util;
  
  import java.lang.reflect.Constructor;
  import java.security.InvalidParameterException;
  import java.util.ArrayList;
  import java.util.Collection;
  import java.util.Date;
  import java.util.Hashtable;
  import java.util.Iterator;
  import java.util.Map;
  
  import javax.management.MalformedObjectNameException;
  import javax.management.MBeanServer;
  import javax.management.Notification;
  import javax.management.NotificationListener;
  import javax.management.ObjectName;
  import javax.naming.Context;
  import javax.naming.InitialContext;
  import javax.naming.Name;
  import javax.naming.NamingException;
  import javax.naming.NameNotFoundException;
  import javax.naming.Reference;
  import javax.naming.StringRefAddr;
  
  import org.jboss.logging.Log;
  import org.jboss.naming.NonSerializableFactory;
  import org.jboss.util.ServiceMBeanSupport;
  
  import management.J2EEApplication;
  
  /**
   * Scheduler Instance to allow clients to run this as a
   * scheduling service for any Schedulable instances.
   *
   * @author Andreas Schaefer ([EMAIL PROTECTED])
   **/
  public class Scheduler
 extends ServiceMBeanSupport
 implements SchedulerMBean
  {
  
 // -
 // Constants
 // -  
  
 public static String JNDI_NAME = "scheduler:domain";
 public static String JMX_NAME = "scheduler";
  
 // -
 // Members
 // -  
  
 private MBeanServer mServer;
 private String mName;
 
 private long mSchedulePeriod;
 private int mRemainingRepetitions = 0;
 private int mActualSchedule = -1;
 private boolean mScheduleIsStarted = false;
 private boolean mWaitForNextCallToStop = false;
 private ObjectName mTimer;
 private Schedulable mSchedulable;
 
 private boolean mStartOnStart = false;
 private String mSchedulableClass;
 private Object[] mInitArguments;
 private String[] mInitTypes;
 private Date mStartDate;
 private long mPeriod;
 private int mRepetitions;
  
 // -
 // Constructors
 // -  
  
 /**
  * Default (no-args) Constructor
  **/
 public Scheduler()
 {
mName = null;
 }
  
 /**
  * Constructor with the necessary attributes to be set
  *
  * @param pName Name of the MBean
  **/
 public Scheduler( String pName )
 {
mName = pName;
 }
  
 /**
  * Constructor with the necessary 

[JBoss-dev] CVS update: jboss/src/main/org/jboss/configuration ConfigurationService.java

2001-06-10 Thread schaefera

  User: schaefera
  Date: 01/06/10 00:49:09

  Modified:src/main/org/jboss/configuration ConfigurationService.java
  Log:
  Added primitive value support for Constructor Arguments. As type just enter
  the same as you use as data type ("int", "long" etc.).
  
  Revision  ChangesPath
  1.29  +37 -3 jboss/src/main/org/jboss/configuration/ConfigurationService.java
  
  Index: ConfigurationService.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/configuration/ConfigurationService.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- ConfigurationService.java 2001/05/04 22:47:14 1.28
  +++ ConfigurationService.java 2001/06/10 07:49:09 1.29
  @@ -45,7 +45,7 @@
* @author  Rickard Öberg ([EMAIL PROTECTED])
* @author  [EMAIL PROTECTED]
* @author  Jason Dillon mailto:[EMAIL PROTECTED]";><[EMAIL PROTECTED]>
  - * @version $Revision: 1.28 $
  + * @version $Revision: 1.29 $
*/
   public class ConfigurationService
   extends ServiceMBeanSupport
  @@ -462,8 +462,42 @@
   //
   // NOTE: should coerce value to the correct type??
   //
  -info.signature[j] = arg.getAttribute("type");
  -info.params[j] = arg.getAttribute("value");
  +// Add support for primitive Data Types
  +String signature = arg.getAttribute("type");
  +String value = arg.getAttribute("value");
  +Object realValue = value;
  +if( signature != null ) {
  +   if( signature.equals( "int" ) ) {
  +  signature = Integer.TYPE.getName();
  +  realValue = new Integer( value );
  +   } else
  +   if( signature.equals( "long" ) ) {
  +  signature = Long.TYPE.getName();
  +  realValue = new Long( value );
  +   } else
  +   if( signature.equals( "byte" ) ) {
  +  signature = Byte.TYPE.getName();
  +  realValue = new Byte( value );
  +   } else
  +   if( signature.equals( "char" ) ) {
  +  signature = Character.TYPE.getName();
  +  realValue = new Character( value.charAt( 0 ) );
  +   } else
  +   if( signature.equals( "float" ) ) {
  +  signature = Float.TYPE.getName();
  +  realValue = new Float( value );
  +   } else
  +   if( signature.equals( "double" ) ) {
  +  signature = Double.TYPE.getName();
  +  realValue = new Double( value );
  +   } else
  +   if( signature.equals( "boolean" ) ) {
  +  signature = Boolean.TYPE.getName();
  +  realValue = new Boolean( value );
  +   }
  +}
  +info.signature[j] = signature;
  +info.params[j] = realValue;
   }
   }
   
  
  
  

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



[JBoss-dev] CVS update: jboss/src/etc/conf/default jboss.jcml

2001-06-10 Thread schaefera

  User: schaefera
  Date: 01/06/10 00:47:47

  Modified:src/etc/conf/default jboss.jcml
  Log:
  Added the example for a scheduling Task supported by the new Scheduler.
  
  Revision  ChangesPath
  1.37  +17 -0 jboss/src/etc/conf/default/jboss.jcml
  
  Index: jboss.jcml
  ===
  RCS file: /cvsroot/jboss/jboss/src/etc/conf/default/jboss.jcml,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- jboss.jcml2001/06/04 22:55:12 1.36
  +++ jboss.jcml2001/06/10 07:47:47 1.37
  @@ -418,6 +418,23 @@
 
   
 
  +  
  +  
  +  
  +
  +  
 
 
   
  
  
  

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



[JBoss-dev] CVS update: jboss/src/etc/conf/default jboss.jcml

2001-06-04 Thread schaefera

  User: schaefera
  Date: 01/06/04 15:55:12

  Modified:src/etc/conf/default jboss.jcml
  Log:
  Adjusted the Server Data Collector to work with the Container-MBeans to
  get its management information.
  
  Revision  ChangesPath
  1.36  +7 -5  jboss/src/etc/conf/default/jboss.jcml
  
  Index: jboss.jcml
  ===
  RCS file: /cvsroot/jboss/jboss/src/etc/conf/default/jboss.jcml,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- jboss.jcml2001/05/22 22:18:20 1.35
  +++ jboss.jcml2001/06/04 22:55:12 1.36
  @@ -136,6 +136,13 @@
 
   
 
  +  
  +  
  +  
  +5000
  +  
  +
  +  
 
 
   
  @@ -403,11 +410,6 @@
   user_id
   password
 
  -
  -  
  -  
  -  
  -  
   
 
 

[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb ContainerFactory.java

2001-06-04 Thread schaefera

  User: schaefera
  Date: 01/06/04 15:55:15

  Modified:src/main/org/jboss/ejb ContainerFactory.java
  Log:
  Adjusted the Server Data Collector to work with the Container-MBeans to
  get its management information.
  
  Revision  ChangesPath
  1.72  +19 -45jboss/src/main/org/jboss/ejb/ContainerFactory.java
  
  Index: ContainerFactory.java
  ===
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/ContainerFactory.java,v
  retrieving revision 1.71
  retrieving revision 1.72
  diff -u -r1.71 -r1.72
  --- ContainerFactory.java 2001/06/03 21:19:52 1.71
  +++ ContainerFactory.java 2001/06/04 22:55:15 1.72
  @@ -82,7 +82,7 @@
   *   @author Peter Antman ([EMAIL PROTECTED])
   *   @author Scott Stark([EMAIL PROTECTED])
   *
  -*   @version $Revision: 1.71 $
  +*   @version $Revision: 1.72 $
   */
   public class ContainerFactory
 extends org.jboss.util.ServiceMBeanSupport
  @@ -332,11 +332,9 @@
 // create the _real_ classloader for this app
 ClassLoader cl = new URLClassLoader( jarUrls, 
Thread.currentThread().getContextClassLoader() );
 app.setClassLoader( cl );
  -  // Create data container for deployed EJBs management data
  -  Module module = new Module( "EJB", "??" );
   
 for( int i = 0; i < jarUrls.length; i++ )
  -   deploy( app, jarUrls[ i ], cl, module );
  +   deploy( app, jarUrls[ i ], cl );
   
 // Init application
 app.init();
  @@ -351,29 +349,6 @@
 log.log( "Deployed application: " + app.getName() );
 // Register deployment. Use the application name in the hashtable
 deployments.put( appUrl, app );
  -  try
  - {
  - // Save EJBs management data: application
  - log.log( "Add module: " + module + ", to app: " + appId );
  - getServer().invoke(
  - new ObjectName( "Management", "service", "Collector" ),
  -"saveModule",
  -new Object[] {
  -   appId,
  -   new Integer( org.jboss.mgt.Application.EJBS ),
  -   module
  -},
  -new String[] {
  -   String.class.getName(),
  -   Integer.TYPE.getName(),
  -   module.getClass().getName()
  -}
  - );
  - }
  -  catch( Exception e )
  - {
  - log.exception( e );
  - }
 }
   catch( Exception e )
 {
  @@ -398,7 +373,7 @@
 }
   }
   
  -  private void deploy( Application app, URL url, ClassLoader cl, Module module )
  +  private void deploy( Application app, URL url, ClassLoader cl )
   throws NamingException, Exception
   {
 // Create a file loader with which to load the files
  @@ -463,11 +438,21 @@
   BeanMetaData bean = (BeanMetaData) beans.next();
   
   log.log( "Deploying " + bean.getEjbName() );
  -EJB ejb = new EJB();
  -module.addItem( ejb );
  -ejb.setName( bean.getEjbName() );
  -app.addContainer( createContainer( bean, cl, localCl, ejb ) );
  -ejb.setDeployed( true );
  +app.addContainer( createContainer( bean, cl, localCl ) );
  +}
  +  // Inform the Data Collector that new/old EJBs were deployed
  +  try
  +{
  +getServer().invoke(
  +  new ObjectName( "Management", "service", "Collector" ),
  +  "refresh",
  +  new Object[] {},
  +  new String[] {}
  +);
  +}
  +  catch( Exception e )
  +{
  +e.printStackTrace();
   }
   }
   
  @@ -560,38 +545,27 @@
 // Container Creation
 // **
   
  -  private Container createContainer( BeanMetaData bean, ClassLoader cl, ClassLoader 
localCl, EJB ejb )
  +  private Container createContainer( BeanMetaData bean, ClassLoader cl, ClassLoader 
localCl )
   throws Exception
   {
   // Added message driven deployment
   if( bean.isMessageDriven() )
 {
  -  ejb.setType( EJB.MESSAGE );
 return createMessageDrivenContainer( bean, cl, localCl );
 }
   else if( bean.isSession() )   // Is session?
 {
 if( ( (SessionMetaData) bean ).isStateless() )   // Is stateless?
   {
  -ejb.setType( EJB.STATELESS_SESSION );
   return createStatelessSessionContainer( bean, cl, localCl );
   }
 else   // Stateful
   {
  -ejb.setType( EJB.STATEFUL_SESSION );
   return createStatefulSessionContainer( bean, cl, localCl );
   }
 }
   else   // Entity
 {
  -  if( ( (EntityMetaData) bean ).isBMP() )
  - {
  - ejb.setType( EJB.ENTITY_BMP );
  - 

[JBoss-dev] CVS update: jboss/src/main/org/jboss/deployment J2eeDeployer.java

2001-06-04 Thread schaefera

  User: schaefera
  Date: 01/06/04 15:55:15

  Modified:src/main/org/jboss/deployment J2eeDeployer.java
  Log:
  Adjusted the Server Data Collector to work with the Container-MBeans to
  get its management information.
  
  Revision  ChangesPath
  1.30  +2 -31 jboss/src/main/org/jboss/deployment/J2eeDeployer.java
  
  Index: J2eeDeployer.java
  ===
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/deployment/J2eeDeployer.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- J2eeDeployer.java 2001/05/23 18:12:46 1.29
  +++ J2eeDeployer.java 2001/06/04 22:55:12 1.30
  @@ -71,7 +71,7 @@
   *   @author mailto:[EMAIL PROTECTED]";>Daniel Schulze
   *   @author Toby Allsopp ([EMAIL PROTECTED])
   *   @author [EMAIL PROTECTED]
  -*   @version $Revision: 1.29 $
  +*   @version $Revision: 1.30 $
   */
   public class J2eeDeployer 
   extends ServiceMBeanSupport
  @@ -207,9 +207,7 @@
   
  try
  {
  -  //  factored out for subclass access
  -addToCollector(d,lCollector);
  -
  +//  factored out for subclass access
  startApplication (d);
  log.log ("J2EE application: " + _url + " is deployed.");
 } 
  @@ -258,33 +256,6 @@
 catch( Exception e ) {
   return null;
 }
  -   }
  -   
  -   /** report of addition to data collector factored out for less
  -*  redundancy with subclasses
  -*  @author schaefera
  -*  @author cgjung
  -*/
  -   protected void addToCollector(Deployment d, ObjectName lCollector) {
  -   try {
  -   // Now the application is deployed add it to the server data collector
  -   Application lApplication = new Application( d.getName(), "DD:Fix later" 
);
  -   server.invoke(
  -   lCollector,
  -   "saveApplication",
  -   new Object[] {
  -   d.getName(),
  -   lApplication
  -   },
  -   new String[] {
  -   "java.lang.String",
  -   lApplication.getClass().getName()
  -   }
  -   );
  -   }
  -   catch( Exception e ) {
  -   log.log("Report of deployment of J2EE application: " + d.getName() + " 
could not be reported.");
  -   }
  }
  
  /** report of removal to data collector factored out for subclass access 
  
  
  

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



[JBoss-dev] CVS update: jboss/src/main/org/jboss/mgt Application.java EJB.java ServerDataCollector.java ServerDataCollectorMBean.java

2001-06-04 Thread schaefera

  User: schaefera
  Date: 01/06/04 15:55:15

  Modified:src/main/org/jboss/mgt Application.java EJB.java
ServerDataCollector.java
ServerDataCollectorMBean.java
  Log:
  Adjusted the Server Data Collector to work with the Container-MBeans to
  get its management information.
  
  Revision  ChangesPath
  1.3   +11 -0 jboss/src/main/org/jboss/mgt/Application.java
  
  Index: Application.java
  ===
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/mgt/Application.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Application.java  2001/05/22 05:08:00 1.2
  +++ Application.java  2001/06/04 22:55:15 1.3
  @@ -88,6 +88,17 @@
  }
  
  /**
  +* Returns the requested module if found
  +*
  +* @param pModuleId Id of the Module to be saved. Please use the
  +*  constants provided in here.
  +* @return Module if found and otherwise null
  +**/
  +   public Module getModule( int pModuleId ) {
  +  return (Module) mModules.get( new Integer( pModuleId ) );
  +   }
  +   
  +   /**
   * @return Collection of Modules deployed with this application. Each
   * item is of type {@link org.jboss.mgt.Module Module}.
   **/
  
  
  
  1.4   +9 -17 jboss/src/main/org/jboss/mgt/EJB.java
  
  Index: EJB.java
  ===
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/mgt/EJB.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- EJB.java  2001/05/22 05:08:00 1.3
  +++ EJB.java  2001/06/04 22:55:15 1.4
  @@ -18,11 +18,9 @@
  // Constants
  // -  
   
  -   public static final int STATELESS_SESSION = 1;
  -   public static final int STATEFUL_SESSION = 2;
  -   public static final int ENTITY_BMP = 3;
  -   public static final int ENTITY_CMP = 4;
  -   public static final int MESSAGE = 5;
  +   public static final int SESSION = 1;
  +   public static final int ENTITY = 2;
  +   public static final int MESSAGE_DRIVEN = 3;
   
  // -
  // Members
  @@ -95,20 +93,14 @@
  public String toString() {
 String lType = null;
 switch( getType() ) {
  - case STATELESS_SESSION:
  -lType = "Stateless Session";
  + case SESSION:
  +lType = "Session";
   break;
  - case STATEFUL_SESSION:
  -lType = "Statefull Session";
  + case ENTITY:
  +lType = "Entity";
   break;
  - case ENTITY_BMP:
  -lType = "Entity BMP";
  -break;
  - case ENTITY_CMP:
  -lType = "Entity CMP";
  -break;
  - case MESSAGE:
  -lType = "Message";
  + case MESSAGE_DRIVEN:
  +lType = "MessageDriven";
 }
   
 return "EJB [ " + getName() + 
  
  
  
  1.3   +103 -1jboss/src/main/org/jboss/mgt/ServerDataCollector.java
  
  Index: ServerDataCollector.java
  ===
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/mgt/ServerDataCollector.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ServerDataCollector.java  2001/05/22 05:08:00 1.2
  +++ ServerDataCollector.java  2001/06/04 22:55:15 1.3
  @@ -9,6 +9,7 @@
   import java.util.ArrayList;
   import java.util.Collection;
   import java.util.Hashtable;
  +import java.util.Iterator;
   import java.util.Map;
   
   import javax.management.MalformedObjectNameException;
  @@ -22,6 +23,7 @@
   import javax.naming.Reference;
   import javax.naming.StringRefAddr;
   
  +import org.jboss.ejb.Container;
   import org.jboss.logging.Log;
   import org.jboss.naming.NonSerializableFactory;
   import org.jboss.util.ServiceMBeanSupport;
  @@ -50,6 +52,9 @@
  private MBeanServer mServer;
  private String mName;
  private Map mApplications = new Hashtable();
  +   private Boolean mRefresh = new Boolean( true );
  +   private Thread mWorker;
  +   private int mRefreshSleep = 2000;
   
  // -
  // Constructors
  @@ -79,6 +84,23 @@
  // Methods
  // -  
   
  +   public int getRefreshSleep() {
  +  return mRefreshSleep;
  +   }
  +   
  +   public void setRefreshSleep( int pSleep ) {
  +  if( pSleep > 0 ) {
  + mRefreshSleep = pSleep;
  +  }
  +   }
  +   
  +   public void refresh() {
  +  // Mark it

[JBoss-dev] CVS update: jboss/src/main/org/jboss/deployment/scope J2eeGlobalScopeDeployer.java

2001-06-04 Thread schaefera

  User: schaefera
  Date: 01/06/04 15:55:15

  Modified:src/main/org/jboss/deployment/scope
J2eeGlobalScopeDeployer.java
  Log:
  Adjusted the Server Data Collector to work with the Container-MBeans to
  get its management information.
  
  Revision  ChangesPath
  1.7   +0 -2  
jboss/src/main/org/jboss/deployment/scope/J2eeGlobalScopeDeployer.java
  
  Index: J2eeGlobalScopeDeployer.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/deployment/scope/J2eeGlobalScopeDeployer.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- J2eeGlobalScopeDeployer.java  2001/05/28 16:16:10 1.6
  +++ J2eeGlobalScopeDeployer.java  2001/06/04 22:55:15 1.7
  @@ -295,8 +295,6 @@
   source.onDeploy();
   // redirect all modules to the responsible deployers
   startModules(_d,source,oldCl);
  -// and report successful deployment to collector
  -addToCollector(_d,lCollector);
   } catch(Exception e) {
   stopApplication(_d,new java.util.ArrayList(),null,scope,lCollector);
   throw new J2eeDeploymentException("could not deploy "+_d.getName());
  
  
  

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



[JBoss-dev] CVS update: manual/src/docs howtotimer.xml

2001-05-30 Thread schaefera

  User: schaefera
  Date: 01/05/30 22:47:33

  Modified:src/docs howtotimer.xml
  Log:
  Forgot something (need an upcast after the lServer.invoke() call).
  
  Revision  ChangesPath
  1.5   +2 -2  manual/src/docs/howtotimer.xml
  
  Index: howtotimer.xml
  ===
  RCS file: /cvsroot/jboss/manual/src/docs/howtotimer.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- howtotimer.xml2001/05/31 05:45:33 1.4
  +++ howtotimer.xml2001/05/31 05:47:33 1.5
  @@ -149,7 +149,7 @@

   
  Date lNext = new Date( new Date().getTime() + Timer.ONE_MINUTE );
  -   Integer lOneMinuteTimer = lServer.invoke(
  +   Integer lOneMinuteTimer = (Integer) lServer.invoke(
 lTimer.getObjectName(),
 "addNotification",
 new Object[] { 
  @@ -175,7 +175,7 @@

   
  Date lNext = new Date( new Date().getTime() + Timer.ONE_HOUR );
  -   Integer lOneHourTimer = lServer.invoke(
  +   Integer lOneHourTimer = (Integer) lServer.invoke(
 lTimer.getObjectName(),
 "addNotification",
 new Object[] { 
  
  
  

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



[JBoss-dev] CVS update: manual/src/docs howtotimer.xml

2001-05-30 Thread schaefera

  User: schaefera
  Date: 01/05/30 22:45:33

  Modified:src/docs howtotimer.xml
  Log:
  Fixed a bug with the return value of the NotificationListener.handleNotification()
  and the Constant (ONE_MINUTE) which was set wrongly to ONE_HOUR thanx to
  the support of Alex McClennan.
  
  Revision  ChangesPath
  1.4   +2 -8  manual/src/docs/howtotimer.xml
  
  Index: howtotimer.xml
  ===
  RCS file: /cvsroot/jboss/manual/src/docs/howtotimer.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- howtotimer.xml2001/05/20 20:33:01 1.3
  +++ howtotimer.xml2001/05/31 05:45:33 1.4
  @@ -58,12 +58,6 @@
   Initialize and start the timer service 
   
  lServer.invoke(
  -  lTimer.getObjectName(),
  -  "init",
  -  new Object[] {},
  -  new String[] {}
  -   );
  -   lServer.invoke(
 lTimer.getObjectName(), 
 "start", 
 new Object[] {},
  @@ -137,7 +131,7 @@
  public class Listener
 implements NotificationListener
  {
  -  public handleNotification(
  +  public void handleNotification(
Notification pNotification,
Object pHandback 
 ) {
  @@ -154,7 +148,7 @@
  this time the Listener.handleNotification() get called.

   
  -   Date lNext = new Date( new Date().getTime() + Timer.ONE_HOUR );
  +   Date lNext = new Date( new Date().getTime() + Timer.ONE_MINUTE );
  Integer lOneMinuteTimer = lServer.invoke(
 lTimer.getObjectName(),
 "addNotification",
  
  
  

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



[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb ContainerFactory.java

2001-05-30 Thread schaefera

  User: schaefera
  Date: 01/05/30 22:38:51

  Modified:src/main/org/jboss/ejb ContainerFactory.java
  Log:
  Added a MBean Wrapper for each created Container (as mentioned earlier
  in an Email) to be able to get a handle on deployed EJBs.
  
  Revision  ChangesPath
  1.70  +31 -3 jboss/src/main/org/jboss/ejb/ContainerFactory.java
  
  Index: ContainerFactory.java
  ===
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/ContainerFactory.java,v
  retrieving revision 1.69
  retrieving revision 1.70
  diff -u -r1.69 -r1.70
  --- ContainerFactory.java 2001/05/22 22:30:49 1.69
  +++ ContainerFactory.java 2001/05/31 05:38:50 1.70
  @@ -82,7 +82,7 @@
   *   @author Peter Antman ([EMAIL PROTECTED])
   *   @author Scott Stark([EMAIL PROTECTED])
   *
  -*   @version $Revision: 1.69 $
  +*   @version $Revision: 1.70 $
   */
   public class ContainerFactory
 extends org.jboss.util.ServiceMBeanSupport
  @@ -611,6 +611,9 @@
   container.setContainerInvoker( createContainerInvoker( conf, cl ) );
   container.setInstancePool( createInstancePool( conf, cl ) );
   
  +//AS Test the exposure of the Container through a MBean
  +registerContainer( container );
  +
   return container;
   }
   
  @@ -627,6 +630,9 @@
   container.setContainerInvoker( createContainerInvoker( conf, cl ) );
   container.setInstancePool( createInstancePool( conf, cl ) );
   
  +//AS Test the exposure of the Container through a MBean
  +registerContainer( container );
  +
   return container;
   }
   
  @@ -647,6 +653,9 @@
   // Set persistence manager
   container.setPersistenceManager( (StatefulSessionPersistenceManager) 
cl.loadClass( conf.getPersistenceManager() ).newInstance() );
   
  +//AS Test the exposure of the Container through a MBean
  +registerContainer( container );
  +
   return container;
   }
   
  @@ -680,14 +689,33 @@
 // Set the manager on the container
 container.setPersistenceManager( persistenceManager );
 }
  -
  +//AS Test the exposure of the Container through a MBean
  +registerContainer( container );
  +  
   return container;
   }
   
 // **
 // Helper Methods
 // **
  -
  +  /**
  +   * Register the created container at the JMX server to make the container
  +   * available for outside management
  +   **/
  +  private void registerContainer( Container container ) {
  + try {
  +// Create and register the ContainerMBean
  +ObjectName name = new ObjectName( "Management", "container", 
container.getBeanMetaData().getEjbName() );
  +getServer().createMBean( "org.jboss.mgt.ContainerMgt", name );
  +getServer().invoke( name, "init", new Object[] {}, new String[] {} );
  +getServer().invoke( name, "start", new Object[] {}, new String[] {} );
  +getServer().setAttribute( name, new javax.management.Attribute( 
"Container", container ) );
  + }
  + catch( Exception e ) {
  +e.printStackTrace();
  + }
  +  }
  +  
 private void initializeContainer( Container container, ConfigurationMetaData 
conf, BeanMetaData bean, int transType, ClassLoader cl, ClassLoader localCl )
   throws NamingException, DeploymentException
   {
  
  
  

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



[JBoss-dev] CVS update: jboss/src/main/org/jboss/mgt ContainerMgt.java ContainerMgtMBean.java

2001-05-30 Thread schaefera

  User: schaefera
  Date: 01/05/30 22:38:51

  Added:   src/main/org/jboss/mgt ContainerMgt.java
ContainerMgtMBean.java
  Log:
  Added a MBean Wrapper for each created Container (as mentioned earlier
  in an Email) to be able to get a handle on deployed EJBs.
  
  Revision  ChangesPath
  1.1  jboss/src/main/org/jboss/mgt/ContainerMgt.java
  
  Index: ContainerMgt.java
  ===
  /*
  * JBoss, the OpenSource EJB server
  *
  * Distributable under LGPL license.
  * See terms of license at gnu.org.
  */
  package org.jboss.mgt;
  
  /*
  import java.beans.Beans;
  import java.beans.beancontext.BeanContextServicesSupport;
  import java.net.URL;
  import java.net.URLClassLoader;
  import java.net.MalformedURLException;
  import java.io.File;
  import java.io.InputStream;
  import java.io.FileInputStream;
  import java.io.FileOutputStream;
  import java.io.IOException;
  import java.rmi.RemoteException;
  import java.rmi.ServerException;
  import java.rmi.server.UnicastRemoteObject;
  import java.util.Properties;
  import java.util.Iterator;
  import java.util.HashMap;
  import java.util.ArrayList;
  import java.util.StringTokenizer;
  import java.util.jar.JarFile;
  import java.util.jar.Manifest;
  import java.util.jar.Attributes;
  */
  
  import javax.naming.Context;
  import javax.naming.InitialContext;
  import javax.naming.Name;
  import javax.naming.NameNotFoundException;
  import javax.naming.NamingException;
  import javax.management.MBeanServer;
  import javax.management.MBeanRegistration;
  import javax.management.ObjectName;
  import javax.transaction.TransactionManager;
  
  import org.jboss.ejb.Container;
  
  import org.jboss.logging.Log;
  import org.jboss.logging.ConsoleLogging;
  import org.jboss.logging.ConsoleLoggingMBean;
  
  import org.jboss.util.MBeanProxy;
  import org.jboss.web.WebServiceMBean;
  
  import org.jboss.metadata.ApplicationMetaData;
  import org.jboss.metadata.BeanMetaData;
  import org.jboss.metadata.SessionMetaData;
  import org.jboss.metadata.EntityMetaData;
  import org.jboss.metadata.MessageDrivenMetaData;
  import org.jboss.metadata.ConfigurationMetaData;
  import org.jboss.metadata.XmlLoadable;
  import org.jboss.metadata.XmlFileLoader;
  import org.jboss.logging.Logger;
  
  import org.jboss.mgt.EJB;
  import org.jboss.mgt.Module;
  
  /**
  *   A ContainerMgt is used as the long arm of a deployed EJB's container.
  *
  *   @see Container
  *   @author Andreas Schaefer ([EMAIL PROTECTED])
  *
  *   @version $Revision: 1.1 $
  */
  public class ContainerMgt
extends org.jboss.util.ServiceMBeanSupport
implements ContainerMgtMBean
  {
 // Attributes 
 // Container this is the management proxy for
 Container mContainer = null;
 // The logger of this service
 Log mLog = Log.createLog( getName() );
  
 // Public 
  
 public void setContainer( Container pContainer ) {
mContainer = pContainer;
 }
 
 public Container getContainer() {
return mContainer;
 }
 
 /**
 * Implements the abstract getObjectName() method in superclass
 * to return this service's name.
 *
 * @param   server
 * @param   name
 *
 * @exception MalformedObjectNameException
 * @return
 */
 public ObjectName getObjectName( MBeanServer server, ObjectName name )
throws javax.management.MalformedObjectNameException
 {
return name;
 }
 
 /**
 * Implements the abstract getName() method in superclass to
 * return the name of this object.
 *
 * @return 'Container factory'
 */
 public String getName() {
return "Container Management Proxy";
 }
 
 /**
 * Implements the template method in superclass. This method stops all the
 * applications in this server.
 */
 public void stopService() {
 }
 
 /**
 * Implements the template method in superclass. This method destroys all
 * the applications in this server and clears the deployments list.
 */
 public void destroyService() {
 }
 
  }
  
  
  
  1.1  jboss/src/main/org/jboss/mgt/ContainerMgtMBean.java
  
  Index: ContainerMgtMBean.java
  ===
  /*
   * JBoss, the OpenSource EJB server
   *
   * Distributable under LGPL license.
   * See terms of license at gnu.org.
   */
  package org.jboss.mgt;
  
  import org.jboss.ejb.Container;
  
  /**
   *   This is the interface of the ContainerMgt that is exposed for administration
   *
   *   @see ContainerMgt
   *   @author Andreas Schaefer ([EMAIL PROTECTED])
   *
   *   @version $Revision: 1.1 $
   */
  public interface ContainerMgtMBean
exten

[JBoss-dev] CVS update: jboss/src/main/org/jboss/deployment J2eeDeployer.java

2001-05-22 Thread schaefera

  User: schaefera
  Date: 01/05/22 15:30:49

  Modified:src/main/org/jboss/deployment J2eeDeployer.java
  Log:
  Catch the exceptions for the management calls because the installation
  is optional.
  
  Revision  ChangesPath
  1.27  +3 -51 jboss/src/main/org/jboss/deployment/J2eeDeployer.java
  
  Index: J2eeDeployer.java
  ===
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/deployment/J2eeDeployer.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- J2eeDeployer.java 2001/05/22 05:07:59 1.26
  +++ J2eeDeployer.java 2001/05/22 22:30:49 1.27
  @@ -71,7 +71,7 @@
   *   @author mailto:[EMAIL PROTECTED]";>Daniel Schulze
   *   @author Toby Allsopp ([EMAIL PROTECTED])
   *   @author [EMAIL PROTECTED]
  -*   @version $Revision: 1.26 $
  +*   @version $Revision: 1.27 $
   */
   public class J2eeDeployer 
   extends ServiceMBeanSupport
  @@ -217,7 +217,7 @@
  {
   try {
   // Now the application is deployed add it to the server data collector
  -Application lApplication = convert2Application( d.getName(), d );
  +Application lApplication = new Application( d.getName(), "DD:Fix later" 
);
   server.invoke(
  lCollector,
  "saveApplication",
  @@ -232,7 +232,7 @@
   );
   }
   catch( Exception e ) {
  -   log.log ("Report of deployment of J2EE application: " + _url + " could 
not be reported.");
  +   log.log ("Report of deployment of J2EE application: " + d.getName() + " 
could not be reported.");
   }
  startApplication (d);
  log.log ("J2EE application: " + _url + " is deployed.");
  @@ -699,53 +699,5 @@
   
 // set it as the context class loader for the deployment thread
 Thread.currentThread().setContextClassLoader(appCl);
  -   }
  -   
  -   /**
  -* Converts a given Deployment to a Management Application
  -*
  -* @param pId Application Id
  -* @param pDeployment Deployment to be converted
  -*
  -* @return Converted Applicaiton
  -**/
  -   public Application convert2Application(
  -  String pId,
  -  Deployment pDeployment
  -   ) {
  -  // Create Applications
  -  Application lApplication = new Application(
  - pId,
  - "DD:FixeLater"
  -  );
  -  // Go through web applications
  -  Iterator i = pDeployment.webModules.iterator();
  -  Collection lItems = new ArrayList();
  -  while( i.hasNext() ) {
  - Deployment.Module lModule = (Deployment.Module) i.next();
  - // Add a Web Module
  - lApplication.saveModule(
  -Application.SERVLETS,
  -new Module(
  -   lModule.webContext,
  -   "DD:FixeLater"
  -)
  - );
  -  }
  -  // Go through ejb applications
  -  i = pDeployment.ejbModules.iterator();
  -  lItems = new ArrayList();
  -  while( i.hasNext() ) {
  - Deployment.Module lModule = (Deployment.Module) i.next();
  - // Add an EJB Module
  - lApplication.saveModule(
  -Application.EJBS,
  -new Module(
  -   ( (URL) lModule.localUrls.firstElement() ).getFile(),
  -   "DD:FixeLater"
  -)
  - );
  -  }
  -  return lApplication;
  }
   }
  
  
  

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



[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb ContainerFactory.java

2001-05-22 Thread schaefera

  User: schaefera
  Date: 01/05/22 15:30:49

  Modified:src/main/org/jboss/ejb ContainerFactory.java
  Log:
  Catch the exceptions for the management calls because the installation
  is optional.
  
  Revision  ChangesPath
  1.69  +29 -20jboss/src/main/org/jboss/ejb/ContainerFactory.java
  
  Index: ContainerFactory.java
  ===
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/ContainerFactory.java,v
  retrieving revision 1.68
  retrieving revision 1.69
  diff -u -r1.68 -r1.69
  --- ContainerFactory.java 2001/05/22 05:08:00 1.68
  +++ ContainerFactory.java 2001/05/22 22:30:49 1.69
  @@ -82,7 +82,7 @@
   *   @author Peter Antman ([EMAIL PROTECTED])
   *   @author Scott Stark([EMAIL PROTECTED])
   *
  -*   @version $Revision: 1.68 $
  +*   @version $Revision: 1.69 $
   */
   public class ContainerFactory
 extends org.jboss.util.ServiceMBeanSupport
  @@ -351,22 +351,29 @@
 log.log( "Deployed application: " + app.getName() );
 // Register deployment. Use the application name in the hashtable
 deployments.put( appUrl, app );
  -  // Save EJBs management data: application
  -  log.log( "Add module: " + module + ", to app: " + appId );
  -  getServer().invoke(
  -  new ObjectName( "Management", "service", "Collector" ),
  - "saveModule",
  - new Object[] {
  -appId,
  -new Integer( org.jboss.mgt.Application.EJBS ),
  -module
  - },
  - new String[] {
  -String.class.getName(),
  -Integer.TYPE.getName(),
  -module.getClass().getName()
  +  try
  + {
  + // Save EJBs management data: application
  + log.log( "Add module: " + module + ", to app: " + appId );
  + getServer().invoke(
  + new ObjectName( "Management", "service", "Collector" ),
  +"saveModule",
  +new Object[] {
  +   appId,
  +   new Integer( org.jboss.mgt.Application.EJBS ),
  +   module
  +},
  +new String[] {
  +   String.class.getName(),
  +   Integer.TYPE.getName(),
  +   module.getClass().getName()
  +}
  + );
}
  -  );
  +  catch( Exception e )
  + {
  + log.exception( e );
  + }
 }
   catch( Exception e )
 {
  @@ -460,6 +467,7 @@
   module.addItem( ejb );
   ejb.setName( bean.getEjbName() );
   app.addContainer( createContainer( bean, cl, localCl, ejb ) );
  +ejb.setDeployed( true );
   }
   }
   
  @@ -488,7 +496,7 @@
   app.stop();
   app.destroy();
   try
  -{
  +   {
  // Remove EJBs management data
  getServer().invoke(
 new ObjectName( "Management", "service", "Collector" ),
  @@ -502,10 +510,11 @@
Integer.TYPE.getName()
 }
  );
  -}
  -catch( Exception e ) {
  +   }
  +catch( Exception e )
  +   {
  log.exception( e );
  -}
  +   }
   try {
   if ( app.getClassLoader() != null ) {
   // Remove from webserver 
  
  
  

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



[JBoss-dev] CVS update: jboss/src/main/org/jboss/deployment J2eeDeployer.java

2001-05-21 Thread schaefera

  User: schaefera
  Date: 01/05/21 22:08:00

  Modified:src/main/org/jboss/deployment J2eeDeployer.java
  Log:
  Modified the EJB deployment therefore that it can report the deployed
  EJBs for a given application to the Data Collector.
  
  Revision  ChangesPath
  1.26  +20 -21jboss/src/main/org/jboss/deployment/J2eeDeployer.java
  
  Index: J2eeDeployer.java
  ===
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/deployment/J2eeDeployer.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- J2eeDeployer.java 2001/05/21 19:49:10 1.25
  +++ J2eeDeployer.java 2001/05/22 05:07:59 1.26
  @@ -71,7 +71,7 @@
   *   @author mailto:[EMAIL PROTECTED]";>Daniel Schulze
   *   @author Toby Allsopp ([EMAIL PROTECTED])
   *   @author [EMAIL PROTECTED]
  -*   @version $Revision: 1.25 $
  +*   @version $Revision: 1.26 $
   */
   public class J2eeDeployer 
   extends ServiceMBeanSupport
  @@ -215,16 +215,14 @@
   
  try
  {
  -   startApplication (d);
  -   log.log ("J2EE application: " + _url + " is deployed.");
   try {
   // Now the application is deployed add it to the server data collector
  -Application lApplication = convert2Application( _url, d );
  +Application lApplication = convert2Application( d.getName(), d );
   server.invoke(
  lCollector,
  "saveApplication",
  new Object[] {
  -  _url,
  +  d.getName(),
 lApplication
  },
  new String[] {
  @@ -236,6 +234,8 @@
   catch( Exception e ) {
  log.log ("Report of deployment of J2EE application: " + _url + " could 
not be reported.");
   }
  +   startApplication (d);
  +   log.log ("J2EE application: " + _url + " is deployed.");
 } 
 catch (Exception _e)
 {
  @@ -475,7 +475,8 @@
tmp.toArray( jarUrls );
// Call the ContainerFactory that is loaded in the JMX server
server.invoke(jarDeployer, "deploy",
  -new Object[]{ _d.localUrl.toString(), jarUrls }, new String[]{ 
String.class.getName(), String[].class.getName() } );
  +new Object[]{ _d.localUrl.toString(), jarUrls, moduleName },
  +new String[]{ String.class.getName(), String[].class.getName(), 
String.class.getName() } );
   
// Deploy the web application modules
it = _d.webModules.iterator ();
  @@ -495,7 +496,6 @@
   // since tomcat changes the context classloader...
   Thread.currentThread().setContextClassLoader (appCl);
}
  -
 }
 catch (MBeanException _mbe)
 {
  @@ -713,40 +713,39 @@
 String pId,
 Deployment pDeployment
  ) {
  -  Collection lModules = new ArrayList();
  +  // Create Applications
  +  Application lApplication = new Application(
  + pId,
  + "DD:FixeLater"
  +  );
 // Go through web applications
 Iterator i = pDeployment.webModules.iterator();
 Collection lItems = new ArrayList();
 while( i.hasNext() ) {
Deployment.Module lModule = (Deployment.Module) i.next();
// Add a Web Module
  - lModules.add(
  + lApplication.saveModule(
  +Application.SERVLETS,
   new Module(
  lModule.webContext,
  -   "DD:FixeLater",
  -   null
  +   "DD:FixeLater"
   )
);
 }
 // Go through ejb applications
  -  i = pDeployment.webModules.iterator();
  +  i = pDeployment.ejbModules.iterator();
 lItems = new ArrayList();
 while( i.hasNext() ) {
Deployment.Module lModule = (Deployment.Module) i.next();
// Add an EJB Module
  - lModules.add(
  + lApplication.saveModule(
  +Application.EJBS,
   new Module(
  ( (URL) lModule.localUrls.firstElement() ).getFile(),
  -   "DD:FixeLater",
  -   null
  +   "DD:FixeLater"
   )
);
 }
  -  // Create Applications
  -  return new Application(
  - pId,
  - "DD:FixeLater",
  - lModules
  -  );
  +  return lApplication;
  }
   }
  
  
  

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



[JBoss-dev] CVS update: jboss/src/main/org/jboss/mgt Application.java EJB.java Item.java Module.java ServerDataCollector.java ServerDataCollectorMBean.java

2001-05-21 Thread schaefera

  User: schaefera
  Date: 01/05/21 22:08:00

  Modified:src/main/org/jboss/mgt Application.java EJB.java Item.java
Module.java ServerDataCollector.java
ServerDataCollectorMBean.java
  Log:
  Modified the EJB deployment therefore that it can report the deployed
  EJBs for a given application to the Data Collector.
  
  Revision  ChangesPath
  1.2   +39 -20jboss/src/main/org/jboss/mgt/Application.java
  
  Index: Application.java
  ===
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/mgt/Application.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Application.java  2001/05/14 18:39:27 1.1
  +++ Application.java  2001/05/22 05:08:00 1.2
  @@ -9,6 +9,8 @@
   import java.io.Serializable;
   import java.util.ArrayList;
   import java.util.Collection;
  +import java.util.Hashtable;
  +import java.util.Map;
   
   /**
* Contains the management information about
  @@ -20,34 +22,39 @@
  implements Serializable
   {
  // -
  +   // Constants
  +   // -  
  +
  +   public static final int EJBS = 1;
  +   public static final int SERVLETS = 2;
  +   public static final int RARS = 3;
  +
  +   // -
  // Members
  // -  
   
  private String mApplicationId;
  private String mDeploymentDescriptor;
  -   private Collection mModules;
  +   private Map mModules = new Hashtable();
   
  // -
  // Constructors
  // -
   
  /**
  +* Creates an empty application
  +*
   * @param pApplicationId Id of these Application which must be unique within
   *   the node/server.
   * @param pDeploymentDescriptor Deployment Descriptor of this application
   *  which maybe is not set.
  -* @param pModules Collection of modules deployed with the given application
  -* each item is of type {@link org.jboss.mgt.JBossModule
  -* JBossModule}.
   **/
  public Application(
 String pApplicationId,
  -  String pDeploymentDescriptor,
  -  Collection pModules
  +  String pDeploymentDescriptor
  ) {
 mApplicationId = pApplicationId;
 setDeploymentDescriptor( pDeploymentDescriptor );
  -  setModules( pModules );
  }
   
  // -
  @@ -82,27 +89,39 @@
  
  /**
   * @return Collection of Modules deployed with this application. Each
  -* item is of type {@link org.jboss.mgt.JBossModule JBossModule}.
  +* item is of type {@link org.jboss.mgt.Module Module}.
   **/
  public Collection getModules() {
  -  return mModules;
  +  return new ArrayList( mModules.values() );
  }
  
  /**
  -* Sets a new list of modules
  +* Saves the given Module either by registering as new Module
  +* or updating the registered Module
   *
  -* @param pModules New list of modules to be set
  +* @param pModuleId Id of the Module to be saved. Please use the
  +*  constants provided in here.
  +* @param pModule Module to be saved
  +**/
  +   public void saveModule(
  +  int pModuleId,
  +  Module pModule
  +   ) {
  +  mModules.put( new Integer( pModuleId ), pModule );
  +   }
  +
  +   /**
  +* Removes the registered Module if found
  +*
  +* @param pModuleId Id of the Module to be removed. Please use the
  +*  constants provided in here.
   **/
  -   public void setModules( Collection pModules ) {
  -  if( pModules == null ) {
  - // If null is passed then keep the list
  - mModules = new ArrayList();
  -  }
  -  else {
  - mModules = pModules;
  -  }
  +   public void removeModule(
  +  int pModuleId
  +   ) {
  +  mModules.remove( new Integer( pModuleId ) );
  }
  -   
  +
  public String toString() {
 return "Application [ " + getId() +
", deployment descriptor : " + getDeploymentDescriptor() +
  
  
  
  1.3   +25 -0 jboss/src/main/org/jboss/mgt/EJB.java
  
  Index: EJB.java
  ===
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/mgt/EJB.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- EJB.java  2001/05/16 19:15:28 1.2
  +

[JBoss-dev] CVS update: jboss/src/main/org/jboss/deployment/scope J2eeGlobalScopeDeployer.java

2001-05-21 Thread schaefera

  User: schaefera
  Date: 01/05/21 22:08:00

  Modified:src/main/org/jboss/deployment/scope
J2eeGlobalScopeDeployer.java
  Log:
  Modified the EJB deployment therefore that it can report the deployed
  EJBs for a given application to the Data Collector.
  
  Revision  ChangesPath
  1.3   +2 -1  
jboss/src/main/org/jboss/deployment/scope/J2eeGlobalScopeDeployer.java
  
  Index: J2eeGlobalScopeDeployer.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/deployment/scope/J2eeGlobalScopeDeployer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- J2eeGlobalScopeDeployer.java  2001/05/21 08:35:18 1.2
  +++ J2eeGlobalScopeDeployer.java  2001/05/22 05:08:00 1.3
  @@ -371,7 +371,8 @@
   tmp.toArray( jarUrls );
   // Call the ContainerFactory that is loaded in the JMX server
   server.invoke(jarDeployer, "deploy",
  -new Object[]{ _d.getLocalUrl().toString(), jarUrls }, new String[]{ 
String.class.getName(), String[].class.getName() } );
  +new Object[]{ _d.getLocalUrl().toString(), jarUrls, moduleName },
  +new String[]{ String.class.getName(), String[].class.getName(), 
String.class.getName() } );
   }
   catch (MBeanException _mbe) {
   log.error("Starting "+moduleName+" failed!");
  
  
  

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



[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb ContainerFactory.java ContainerFactoryMBean.java

2001-05-21 Thread schaefera

  User: schaefera
  Date: 01/05/21 22:08:00

  Modified:src/main/org/jboss/ejb ContainerFactory.java
ContainerFactoryMBean.java
  Log:
  Modified the EJB deployment therefore that it can report the deployed
  EJBs for a given application to the Data Collector.
  
  Revision  ChangesPath
  1.68  +66 -12jboss/src/main/org/jboss/ejb/ContainerFactory.java
  
  Index: ContainerFactory.java
  ===
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/ContainerFactory.java,v
  retrieving revision 1.67
  retrieving revision 1.68
  diff -u -r1.67 -r1.68
  --- ContainerFactory.java 2001/02/27 16:48:08 1.67
  +++ ContainerFactory.java 2001/05/22 05:08:00 1.68
  @@ -65,6 +65,9 @@
   import org.jboss.metadata.XmlFileLoader;
   import org.jboss.logging.Logger;
   
  +import org.jboss.mgt.EJB;
  +import org.jboss.mgt.Module;
  +
   /**
   *   A ContainerFactory is used to deploy EJB applications. It can be given a URL to
   *  an EJB-jar or EJB-JAR XML file, which will be used to instantiate containers and 
make
  @@ -79,7 +82,7 @@
   *   @author Peter Antman ([EMAIL PROTECTED])
   *   @author Scott Stark([EMAIL PROTECTED])
   *
  -*   @version $Revision: 1.67 $
  +*   @version $Revision: 1.68 $
   */
   public class ContainerFactory
 extends org.jboss.util.ServiceMBeanSupport
  @@ -254,16 +257,16 @@
 * @exception   MalformedURLException
 * @exception   DeploymentException
 */
  -  public void deploy( String url )
  +  public void deploy( String url, String appId )
   throws MalformedURLException, DeploymentException
   {
   // Delegate to "real" deployment
  -deploy( new URL( url ) );
  +deploy( new URL( url ), appId );
   }
   //
   // Richard Gyger
   //
  -  public void deploy( String appUrl, String[] jarUrls )
  +  public void deploy( String appUrl, String[] jarUrls, String appId )
   throws MalformedURLException, DeploymentException
   {
   // Delegate to "real" deployment
  @@ -272,7 +275,7 @@
   for( int i = 0; i < tmp.length; i++ )
 tmp[ i ] = new URL( jarUrls[ i ] );
   
  -deploy( new URL( appUrl ), tmp );
  +deploy( new URL( appUrl ), tmp, appId );
   }
   
 /**
  @@ -301,15 +304,15 @@
 *
 * @exception   DeploymentException
 */
  -  public synchronized void deploy( URL url )
  +  public synchronized void deploy( URL url, String appId )
   throws DeploymentException
   {
  -deploy( url, new URL[]{ url } );
  +deploy( url, new URL[]{ url }, appId );
   }
   //
   // Richard Gyger
   //
  -  public synchronized void deploy( URL appUrl, URL[] jarUrls )
  +  public synchronized void deploy( URL appUrl, URL[] jarUrls, String appId )
   throws DeploymentException
   {
   // Create application
  @@ -329,9 +332,11 @@
 // create the _real_ classloader for this app
 ClassLoader cl = new URLClassLoader( jarUrls, 
Thread.currentThread().getContextClassLoader() );
 app.setClassLoader( cl );
  +  // Create data container for deployed EJBs management data
  +  Module module = new Module( "EJB", "??" );
   
 for( int i = 0; i < jarUrls.length; i++ )
  -   deploy( app, jarUrls[ i ], cl );
  +   deploy( app, jarUrls[ i ], cl, module );
   
 // Init application
 app.init();
  @@ -346,6 +351,22 @@
 log.log( "Deployed application: " + app.getName() );
 // Register deployment. Use the application name in the hashtable
 deployments.put( appUrl, app );
  +  // Save EJBs management data: application
  +  log.log( "Add module: " + module + ", to app: " + appId );
  +  getServer().invoke(
  +  new ObjectName( "Management", "service", "Collector" ),
  + "saveModule",
  + new Object[] {
  +appId,
  +new Integer( org.jboss.mgt.Application.EJBS ),
  +module
  + },
  + new String[] {
  +String.class.getName(),
  +Integer.TYPE.getName(),
  +module.getClass().getName()
  + }
  +  );
 }
   catch( Exception e )
 {
  @@ -370,7 +391,7 @@
 }
   }
   
  -  private void deploy( Application app, URL url, ClassLoader cl )
  +  private void deploy( Application app, URL url, ClassLoader cl, Module module )
   throws NamingException, Exception
   {
 // Create a file loader with which to load the files
  @@ -435,7 +456,10 @@
   BeanMetaData bean = (BeanMetaData) beans.next();
   
   log.log( "Deploying " + bean.getEjbName() );
  -app.addContainer( createContainer( bean, cl, localCl ) );
  +EJB ejb = new EJB();
  +module.addItem( ejb );
  +ejb.setName( bean.getEjbNam

[JBoss-dev] CVS update: manual/src/docs howtojmx.xml

2001-05-20 Thread schaefera

  User: schaefera
  Date: 01/05/20 13:33:39

  Modified:src/docs howtojmx.xml
  Log:
  Fixed the layout to make the code easier to read and adjusted to the
  latest changes in the JMX Connector.
  
  Revision  ChangesPath
  1.3   +453 -455  manual/src/docs/howtojmx.xml
  
  Index: howtojmx.xml
  ===
  RCS file: /cvsroot/jboss/manual/src/docs/howtojmx.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- howtojmx.xml  2001/03/21 08:30:20 1.2
  +++ howtojmx.xml  2001/05/20 20:33:39 1.3
  @@ -1,460 +1,458 @@
   

  - JMX Connector Description and HowTo   
  - Author:
  - Andreas
  - Shaefer
  - 
  - [EMAIL PROTECTED]   
  - 
  - 
  - Introduction
  - 
  - JMX Spec from Sun  
  -  
  -  Sun release recently the final specification, API and Reference Implemenation 
to the  
  -  http://www.javasoft.com/products/JavaManagement/index.html";>
  - Java Management   
  -  Extention(JMX)
  - . 
  -  The idea behind this is to provide an API to which the component vendors can 
make their components   
  -  manageable and the management tools vendor can use this API to manage these 
components.   
  -  
  -  Therefore the whole JMX is separated into 3 parts:   
  - 
  -   Components implement a 
certain API to offer their management API to
  - the JMX world. There are 3 ways: through an Interface, through a API
  - descriptions (Open MBean) and through a Model MBean (but for this
  - have a look at the spec). 
  -   
  -   
  - 
  -   JMX Agent which 
contains a MBean Server, certain services like
  - dynamic download, timers, relations etc. and at least one Connector
  - or Adaptor. 
  -   
  -   
  - 
  -   Management Tool using 
a Connector or Adaptor to manage the
  - components of the JMX Agent the tool is connected to. 
  -   
  - 
  -  
  - 
  - 
  - 
  - JMX Implementation in JBoss  
  -   At the moment (8th of September 2000) JBoss uses 
the final release JMX API for its services defined in the   
  -jboss.conf file (in there you see that also HTML
  -  Adaptor and the JMX Connector are manageable components). In addition JBoss 
use the MBean Server implementation 
  -and the HTML adaptor from the JMX-RI.
  -  The JMX Connector also follows the JMX final spec and API. 
  -  
  -  
  -   You use JMX first when you start JBoss because the 
Main class loads the MLET tags from the jboss.conf file and 
  -hand it over to the MBeanServer which loads the
  -  MBean dynamically (MLET is the tag to dynamically load a MBean by the 
MBeanServer). Afterwards it went through 
  -the loaded MBeans and starts all the loaded
  -  MBeans.   
  -   Afterwards you can use JMX either trough the JMX 
HMTL Adaptor on port 8082 or through the new JMX Connector. The 
  -JMX HTML Adaptor is provided by the
  -  JMX-RI and the source code is not available (it is part of Sun's JDMK which 
you have to buy when you want to get 
  -the source as far as I know). The JMX
  -  Connector is part of the JBoss code and should be considered as first draft 
because the Connector is mentioned 
  -within the spec by not further specified. 
  -  
  -  
  -   Finally JMX is used within the shutdown hook to 
terminate all the services before JBoss is terminated itself 
  -(whatever this means) by going through all available
  -  MBeans and send them the stop signal (call the appropriate method). 
  -
  -
  -  
  -
  -
  -   
  -  
  -   
  - Design of the JMX Connector
  -  
  -
  -  
  - Introduction  
  -  
  -  According to the JMX spec the Connector should allow a management tool to 
work on a MBeanServer and its MBeans
  -  from another JVM which can be on the same
  -  computer or a remote computer. One particular Connector is bound to its 
protocol it

[JBoss-dev] CVS update: manual/src/docs howtotimer.xml

2001-05-20 Thread schaefera

  User: schaefera
  Date: 01/05/20 13:33:01

  Modified:src/docs howtotimer.xml
  Log:
  Changed and fixed the layout to make the code read easier.
  
  Revision  ChangesPath
  1.3   +237 -206  manual/src/docs/howtotimer.xml
  
  Index: howtotimer.xml
  ===
  RCS file: /cvsroot/jboss/manual/src/docs/howtotimer.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- howtotimer.xml2001/03/21 08:30:20 1.2
  +++ howtotimer.xml2001/05/20 20:33:01 1.3
  @@ -1,208 +1,239 @@
   
 
  - How To us the Timer MBean  
  - Author:
  - Andreas
  - Shaefer
  - 
  - [EMAIL PROTECTED]  
  - 
  - 
  - Introduction  
  -   
  -As part of the JMX specification each JMX compliant 
server must provide a timer service to let the users
  -   beeing notified at a certain time, in a certain interval and/or number of 
occurrences. 
  -   Therefore you can check for mails, check if some change on target (auto 
deployer) or notify the client for a
  -   date. 
  -
  - 
  - 
  - Preparation  
  -   
  -
  -
  -First you have to add the timer service 
into the jboss.conf therefore that the timer service is loaded, registered
  -   at the JMX server and the initialized and started (done by JBoss's Main.java 
class). This MLET tag looks like
  -   this: 
  -   
  -
  -   
  -  
  -   
  -
  -   
  -
  -   
  -If you are not using JBoss then to the 
following: 
  -
  -
  - 
  -   Create a 
MBeanServer 
  -
  -MBeanServer lServer =
  -  MBeanServerFactory.createMBeanServer();
  -
  - 
  -   
  - 
  -   Load and 
register the Timer MBean 
  -
  -ObjectInstance lTimer =
  -  lServer.createMBean(
  -  "javax.management.timer.Timer", new
  -  ObjectName( "DefaultDomain",
  -  "service", "timer" ) ); 
  -   
  -  
  - 
  -  
  -  
  - 
  - Initialize and start the 
timer service 
  -
  -lServer.invoke(
  -  lTimer.getObjectName(), "init", new
  -  Object[] {}, new String[] {} );
  -  lServer.invoke(
  -  lTimer.getObjectName(), "start", new
  -  Object[] {}, new String[] {} ); 
  -   
  -  
  - 
  - 
  -  
  -   
  -
  -
  -
  -   
  -
  -   
  - Next step is to get the MBeanServer within your 
object to work with the timer. 
  -
  - 
  -This is quite simple if your are in a MBean registered to the same 
JMX server because
  -then you get it when you overwrite preRegister() method. 
  -When you are in the same JVM as the JMX server (in JBoss is any 
instance running
  -within JBoss like EJBs or other classes). Then you can obtain the 
MBeanServer throug:   
  -   MBeanServer 
lServer =
  -  MBeanServerFactory.createMBeanServer();  
  
  - For the rest it is a little bit 
more complicated. In a Java client you can use JBoss RMI
  -connector which will be released as separat package till mid 
December 2000. Then you
  -connect to a MBeanServer through the JMXConne

[JBoss-dev] CVS update: jboss/src/main/org/jboss/mgt EJB.java Servlet.java

2001-05-16 Thread schaefera

  User: schaefera
  Date: 01/05/16 12:15:28

  Modified:src/main/org/jboss/mgt EJB.java Servlet.java
  Log:
  Added a boolean to the classes indicating that they are deployed. The
  most settings within Servlet, EJBs etc. will be taken from the deployement
  descriptors therefore this classes can be kept simple (Marc will like
  this).
  
  Revision  ChangesPath
  1.2   +12 -1 jboss/src/main/org/jboss/mgt/EJB.java
  
  Index: EJB.java
  ===
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/mgt/EJB.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EJB.java  2001/05/16 16:54:17 1.1
  +++ EJB.java  2001/05/16 19:15:28 1.2
  @@ -30,6 +30,7 @@
   
  private String mClass;
  private int mType;
  +   private boolean mDeployed;
   
  // -
  // Constructors
  @@ -37,10 +38,13 @@
   
  /**
   * @param pName Name of the Servlet
  +* @param pType Type of the EJB
  +* @param pDeployed True if the EJB is deployed now
   **/
  public EJB(
 String pName,
  -  int pType
  +  int pType,
  +  boolean pDeployed
  ) {
 super( pName );
 mType = pType;
  @@ -55,6 +59,13 @@
   **/
  public int getType() {
 return mType;
  +   }
  +
  +   /**
  +* @return True if the EJB is deployed now
  +**/
  +   public boolean isDeployed() {
  +  return mDeployed;
  }
   
  public String toString() {
  
  
  
  1.2   +11 -1 jboss/src/main/org/jboss/mgt/Servlet.java
  
  Index: Servlet.java
  ===
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/mgt/Servlet.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Servlet.java  2001/05/16 16:54:17 1.1
  +++ Servlet.java  2001/05/16 19:15:28 1.2
  @@ -22,6 +22,7 @@
   
  private String mClass;
  private Map mParameters;
  +   private boolean mLoaded;
   
  // -
  // Constructors
  @@ -31,11 +32,13 @@
   * @param pName Name of the Servlet
   * @param pClassName Name of the class the servlet is based on
   * @param pParameters Map of the Servlet Parameters
  +* @param pLoaded True if the servlet is loaded now
   **/
  public Servlet(
 String pName,
 String pClassName,
  -  Map pParameters
  +  Map pParameters,
  +  boolean pLoaded
  ) {
 super( pName );
 mClass = pClassName;
  @@ -60,6 +63,13 @@
   **/
  public Map getParameters() {
 return mParameters;
  +   }
  +   
  +   /**
  +* @return True if the servlet is loaded now
  +**/
  +   public boolean isLoaded() {
  +  return mLoaded;
  }
   
  public String toString() {
  
  
  

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



[JBoss-dev] CVS update: jboss/src/main/org/jboss/mgt EJB.java Item.java Servlet.java Module.java

2001-05-16 Thread schaefera

  User: schaefera
  Date: 01/05/16 09:54:17

  Modified:src/main/org/jboss/mgt Module.java
  Added:   src/main/org/jboss/mgt EJB.java Item.java Servlet.java
  Log:
  Added management data container classes allowing the jboss components
  to add and then set their data at the management MBean.
  
  Revision  ChangesPath
  1.2   +3 -3  jboss/src/main/org/jboss/mgt/Module.java
  
  Index: Module.java
  ===
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/mgt/Module.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Module.java   2001/05/14 18:39:27 1.1
  +++ Module.java   2001/05/16 16:54:17 1.2
  @@ -80,7 +80,7 @@
   *
   * @param pItem Item to be added
   **/
  -   public void addItem( Object pItem ) {
  +   public void addItem( Item pItem ) {
 mItems.add( pItem );
  }
 
  @@ -89,13 +89,13 @@
   *
   * @param pItem Item to be removed
   **/
  -   public void removeItem( Object pItem ) {
  +   public void removeItem( Item pItem ) {
 mItems.remove( pItem );
  }
   
  /**
   * @return Collection of Items deployed with this application. Each
  -* item is of type {@link java.lang.Object Object}.
  +* item is of type {@link org.jboss.mgt.Item Item}.
   **/
  public Collection getItems() {
 return mItems;
  
  
  
  1.1  jboss/src/main/org/jboss/mgt/EJB.java
  
  Index: EJB.java
  ===
  /*
   * JBoss, the OpenSource EJB server
   *
   * Distributable under LGPL license.
   * See terms of license at gnu.org.
   */
  package org.jboss.mgt;
  
  /**
   * Contains the management information about a EJB.
   *
   * @author Andreas "Mad" Schaefer ([EMAIL PROTECTED])
   **/
  public class EJB
 extends Item
  {
 // -
 // Constants
 // -  
  
 public static final int STATELESS_SESSION = 1;
 public static final int STATEFUL_SESSION = 2;
 public static final int ENTITY_BMP = 3;
 public static final int ENTITY_CMP = 4;
 public static final int MESSAGE = 5;
  
 // -
 // Members
 // -  
  
 private String mClass;
 private int mType;
  
 // -
 // Constructors
 // -
  
 /**
  * @param pName Name of the Servlet
  **/
 public EJB(
String pName,
int pType
 ) {
super( pName );
mType = pType;
 }
  
 // -
 // Properties (Getters/Setters)
 // -  
  
 /**
  * @return Type of the EJB
  **/
 public int getType() {
return mType;
 }
  
 public String toString() {
String lType = null;
switch( getType() ) {
   case STATELESS_SESSION:
  lType = "Stateless Session";
  break;
   case STATEFUL_SESSION:
  lType = "Statefull Session";
  break;
   case ENTITY_BMP:
  lType = "Entity BMP";
  break;
   case ENTITY_CMP:
  lType = "Entity CMP";
  break;
   case MESSAGE:
  lType = "Message";
}
  
return "EJB [ " + getName() + 
   ", " + lType +
   " ]";
 }
  }
  
  
  
  1.1  jboss/src/main/org/jboss/mgt/Item.java
  
  Index: Item.java
  ===
  /*
   * JBoss, the OpenSource EJB server
   *
   * Distributable under LGPL license.
   * See terms of license at gnu.org.
   */
  package org.jboss.mgt;
  
  import java.io.Serializable;
  
  /**
   * Contains the management information about a Module
   * Item which could be a Servlet, JSP, EJB, EIX etc.
   *
   * @author Andreas "Mad" Schaefer ([EMAIL PROTECTED])
   **/
  public abstract class Item
 implements Serializable
  {
 // -
 // Members
 // -  
  
 private String mName;
  
 // -
 // Constructors
 // ---

[JBoss-dev] CVS update: jboss/src/main/org/jboss/deployment J2eeDeployer.java

2001-05-16 Thread schaefera

  User: schaefera
  Date: 01/05/16 09:54:16

  Modified:src/main/org/jboss/deployment J2eeDeployer.java
  Log:
  Added management data container classes allowing the jboss components
  to add and then set their data at the management MBean.
  
  Revision  ChangesPath
  1.23  +17 -19jboss/src/main/org/jboss/deployment/J2eeDeployer.java
  
  Index: J2eeDeployer.java
  ===
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/deployment/J2eeDeployer.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- J2eeDeployer.java 2001/05/14 18:39:27 1.22
  +++ J2eeDeployer.java 2001/05/16 16:54:16 1.23
  @@ -70,7 +70,7 @@
   *
   *   @author mailto:[EMAIL PROTECTED]";>Daniel Schulze
   *   @author Toby Allsopp ([EMAIL PROTECTED])
  -*   @version $Revision: 1.22 $
  +*   @version $Revision: 1.23 $
   */
   public class J2eeDeployer 
   extends ServiceMBeanSupport
  @@ -704,31 +704,29 @@
 Collection lItems = new ArrayList();
 while( i.hasNext() ) {
Deployment.Module lModule = (Deployment.Module) i.next();
  - lItems.add( lModule.webContext );
  + // Add a Web Module
  + lModules.add(
  +new Module(
  +   lModule.webContext,
  +   "DD:FixeLater",
  +   null
  +)
  + );
 }
  -  // Add Web Module
  -  lModules.add(
  - new Module(
  -"WebModule:FixeLater",
  -"DD:FixeLater",
  -lItems
  - )
  -  );
 // Go through ejb applications
 i = pDeployment.webModules.iterator();
 lItems = new ArrayList();
 while( i.hasNext() ) {
Deployment.Module lModule = (Deployment.Module) i.next();
  - lItems.add( ( (URL) lModule.localUrls.firstElement() ).getFile() );
  + // Add an EJB Module
  + lModules.add(
  +new Module(
  +   ( (URL) lModule.localUrls.firstElement() ).getFile(),
  +   "DD:FixeLater",
  +   null
  +)
  + );
 }
  -  // Add EJB Module
  -  lModules.add(
  - new Module(
  -"EJBModule:FixeLater",
  -"DD:FixeLater",
  -lItems
  - )
  -  );
 // Create Applications
 return new Application(
pId,
  
  
  

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



[JBoss-dev] CVS update: jboss/src/main/org/jboss/deployment J2eeDeployer.java

2001-05-14 Thread schaefera

  User: schaefera
  Date: 01/05/14 11:39:27

  Modified:src/main/org/jboss/deployment J2eeDeployer.java
  Log:
  Implementation of the 1. draft for the JBoss management class in the
  J2EEDeployer to figure out what applications are deployed.
  
  Revision  ChangesPath
  1.22  +88 -1 jboss/src/main/org/jboss/deployment/J2eeDeployer.java
  
  Index: J2eeDeployer.java
  ===
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/deployment/J2eeDeployer.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- J2eeDeployer.java 2001/04/15 05:41:21 1.21
  +++ J2eeDeployer.java 2001/05/14 18:39:27 1.22
  @@ -41,6 +41,9 @@
   import javax.management.RuntimeMBeanException;
   import javax.management.RuntimeErrorException;
   
  +import org.jboss.mgt.Application;
  +import org.jboss.mgt.Module;
  +import org.jboss.mgt.ServerDataCollector;
   import org.jboss.logging.Log;
   import org.jboss.util.MBeanProxy;
   import org.jboss.util.ServiceMBeanSupport;
  @@ -67,7 +70,7 @@
   *
   *   @author mailto:[EMAIL PROTECTED]";>Daniel Schulze
   *   @author Toby Allsopp ([EMAIL PROTECTED])
  -*   @version $Revision: 1.21 $
  +*   @version $Revision: 1.22 $
   */
   public class J2eeDeployer 
   extends ServiceMBeanSupport
  @@ -178,10 +181,24 @@
  {
 URL url = new URL (_url);
 
  +  ObjectName lCollector = null;
  +  try {
  + lCollector = new ObjectName( "Management", "service", "Collector" );
  +  }
  +  catch( Exception e ) {
  +  }
  +  
 // undeploy first if it is a redeploy
 try
 {
undeploy (_url);
  + // Remove application data by its id
  + server.invoke(
  +lCollector,
  +"removeApplication",
  +new Object[] { _url },
  +new String[] { "java.lang.String" }
  + );
 }
 catch (Exception _e)
 {}
  @@ -195,6 +212,25 @@
  {
  startApplication (d);
  log.log ("J2EE application: " + _url + " is deployed.");
  +try {
  +// Now the application is deployed add it to the server data collector
  +Application lApplication = convert2Application( _url, d );
  +server.invoke(
  +   lCollector,
  +   "saveApplication",
  +   new Object[] {
  +  _url,
  +  lApplication
  +   },
  +   new String[] {
  +  "java.lang.String",
  +  lApplication.getClass().getName()
  +   }
  +);
  +}
  +catch( Exception e ) {
  +   log.log ("Report of deployment of J2EE application: " + _url + " could 
not be reported.");
  +}
 } 
 catch (Exception _e)
 {
  @@ -648,5 +684,56 @@
   
 // set it as the context class loader for the deployment thread
 Thread.currentThread().setContextClassLoader(appCl);
  +   }
  +   
  +   /**
  +* Converts a given Deployment to a Management Application
  +*
  +* @param pId Application Id
  +* @param pDeployment Deployment to be converted
  +*
  +* @return Converted Applicaiton
  +**/
  +   public Application convert2Application(
  +  String pId,
  +  Deployment pDeployment
  +   ) {
  +  Collection lModules = new ArrayList();
  +  // Go through web applications
  +  Iterator i = pDeployment.webModules.iterator();
  +  Collection lItems = new ArrayList();
  +  while( i.hasNext() ) {
  + Deployment.Module lModule = (Deployment.Module) i.next();
  + lItems.add( lModule.webContext );
  +  }
  +  // Add Web Module
  +  lModules.add(
  + new Module(
  +"WebModule:FixeLater",
  +"DD:FixeLater",
  +lItems
  + )
  +  );
  +  // Go through ejb applications
  +  i = pDeployment.webModules.iterator();
  +  lItems = new ArrayList();
  +  while( i.hasNext() ) {
  + Deployment.Module lModule = (Deployment.Module) i.next();
  + lItems.add( ( (URL) lModule.localUrls.firstElement() ).getFile() );
  +  }
  +  // Add EJB Module
  +  lModules.add(
  + new Module(
  +"EJBModule:FixeLater",
  +"DD:FixeLater",
  +lItems
  + )
  +  );
  +  // Create Applications
  +  return new Application(
  + pId,
  + "DD:FixeLater",
  + lModules
  +  );
  }
   }
  
  
  

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



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

2001-05-14 Thread schaefera

  User: schaefera
  Date: 01/05/14 11:39:27

  Modified:src/main/org/jboss/jmx/client RMIClientConnectorImpl.java
  Log:
  Implementation of the 1. draft for the JBoss management class in the
  J2EEDeployer to figure out what applications are deployed.
  
  Revision  ChangesPath
  1.6   +1 -0  jboss/src/main/org/jboss/jmx/client/RMIClientConnectorImpl.java
  
  Index: RMIClientConnectorImpl.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/jmx/client/RMIClientConnectorImpl.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- RMIClientConnectorImpl.java   2000/12/11 16:11:54 1.5
  +++ RMIClientConnectorImpl.java   2001/05/14 18:39:27 1.6
  @@ -486,6 +486,7 @@
}
catch( RemoteException re ) {
//AS Not a good style but for now
  + re.printStackTrace();
return null;
}
}
  
  
  

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



[JBoss-dev] CVS update: jboss/src/etc/conf/default jboss.jcml

2001-05-14 Thread schaefera

  User: schaefera
  Date: 01/05/14 11:39:26

  Modified:src/etc/conf/default jboss.jcml
  Log:
  Implementation of the 1. draft for the JBoss management class in the
  J2EEDeployer to figure out what applications are deployed.
  
  Revision  ChangesPath
  1.31  +1 -1  jboss/src/etc/conf/default/jboss.jcml
  
  Index: jboss.jcml
  ===
  RCS file: /cvsroot/jboss/jboss/src/etc/conf/default/jboss.jcml,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- jboss.jcml2001/05/13 03:34:20 1.30
  +++ jboss.jcml2001/05/14 18:39:26 1.31
  @@ -391,7 +391,7 @@
 
 
 
  -  
  +  
   
 
 

[JBoss-dev] CVS update: jboss/src/main/org/jboss/mgt Application.java Module.java ServerDataCollector.java ServerDataCollectorMBean.java JBossApplication.java JBossModule.java JBossServer.java JBossServerMBean.java

2001-05-14 Thread schaefera

  User: schaefera
  Date: 01/05/14 11:39:27

  Added:   src/main/org/jboss/mgt Application.java Module.java
ServerDataCollector.java
ServerDataCollectorMBean.java
  Removed: src/main/org/jboss/mgt JBossApplication.java
JBossModule.java JBossServer.java
JBossServerMBean.java
  Log:
  Implementation of the 1. draft for the JBoss management class in the
  J2EEDeployer to figure out what applications are deployed.
  
  Revision  ChangesPath
  1.1  jboss/src/main/org/jboss/mgt/Application.java
  
  Index: Application.java
  ===
  /*
   * JBoss, the OpenSource EJB server
   *
   * Distributable under LGPL license.
   * See terms of license at gnu.org.
   */
  package org.jboss.mgt;
  
  import java.io.Serializable;
  import java.util.ArrayList;
  import java.util.Collection;
  
  /**
   * Contains the management information about
   * a deployed applications.
   *
   * @author Marc Fleury
   **/
  public class Application
 implements Serializable
  {
 // -
 // Members
 // -  
  
 private String mApplicationId;
 private String mDeploymentDescriptor;
 private Collection mModules;
  
 // -
 // Constructors
 // -
  
 /**
  * @param pApplicationId Id of these Application which must be unique within
  *   the node/server.
  * @param pDeploymentDescriptor Deployment Descriptor of this application
  *  which maybe is not set.
  * @param pModules Collection of modules deployed with the given application
  * each item is of type {@link org.jboss.mgt.JBossModule
  * JBossModule}.
  **/
 public Application(
String pApplicationId,
String pDeploymentDescriptor,
Collection pModules
 ) {
mApplicationId = pApplicationId;
setDeploymentDescriptor( pDeploymentDescriptor );
setModules( pModules );
 }
  
 // -
 // Properties (Getters/Setters)
 // -  
  
 /**
  * @return Id of these Application
  **/
 public String getId() {
return mApplicationId;
 }
 
 /**
  * Returns the deployment descriptor
  *
  * @return Deployment Descriptor of this application which maybe is not set.
  **/
 public String getDeploymentDescriptor() {
return mDeploymentDescriptor;
 }
 
 /**
  * Sets the deployment descriptor
  *
  * @param pDeploymentDescriptor Deployment Descriptor of this application
  *  which maybe is not set.
  **/
 public void setDeploymentDescriptor( String pDeploymentDescriptor ) {
mDeploymentDescriptor = pDeploymentDescriptor;
 }
 
 /**
  * @return Collection of Modules deployed with this application. Each
  * item is of type {@link org.jboss.mgt.JBossModule JBossModule}.
  **/
 public Collection getModules() {
return mModules;
 }
 
 /**
  * Sets a new list of modules
  *
  * @param pModules New list of modules to be set
  **/
 public void setModules( Collection pModules ) {
if( pModules == null ) {
   // If null is passed then keep the list
   mModules = new ArrayList();
}
else {
   mModules = pModules;
}
 }
 
 public String toString() {
return "Application [ " + getId() +
   ", deployment descriptor : " + getDeploymentDescriptor() +
   ", modules: " + getModules() + " ]";
 }
  }
  
  
  
  1.1  jboss/src/main/org/jboss/mgt/Module.java
  
  Index: Module.java
  ===
  /*
   * JBoss, the OpenSource EJB server
   *
   * Distributable under LGPL license.
   * See terms of license at gnu.org.
   */
  package org.jboss.mgt;
  
  import java.io.Serializable;
  import java.util.Collection;
  
  /**
   * Contains the management information about
   * a deployed applications.
   *
   * @author Marc Fleury
   **/
  public class Module
 implements Serializable
  {
 // -
 // Members
 // -  
  
 private String mModuleId;
 private St

[JBoss-dev] CVS update: jboss/src/main/org/jboss/mgt JBossApplication.java JBossModule.java JBossServer.java JBossServerMBean.java

2001-05-12 Thread schaefera

  User: schaefera
  Date: 01/05/12 20:34:20

  Added:   src/main/org/jboss/mgt JBossApplication.java
JBossModule.java JBossServer.java
JBossServerMBean.java
  Log:
  First Draft for the JBoss management classes delivering the necessary
  information for a management tool to work with JBoss.
  
  Revision  ChangesPath
  1.1  jboss/src/main/org/jboss/mgt/JBossApplication.java
  
  Index: JBossApplication.java
  ===
  /*
   * JBoss, the OpenSource EJB server
   *
   * Distributable under LGPL license.
   * See terms of license at gnu.org.
   */
  package org.jboss.mgt;
  
  import java.util.Collection;
  
  /**
   * Contains the management information about
   * a deployed applications.
   *
   * @author Marc Fleury
   **/
  public class JBossApplication {
 // -
 // Members
 // -  
  
 private String mApplicationId;
 private String mDeploymentDescriptor;
 private Collection mModules;
  
 // -
 // Constructors
 // -
  
 /**
  * @param pApplicationId Id of these Application which must be unique within
  *   the node/server.
  * @param pDeploymentDescriptor Deployment Descriptor of this application
  *  which maybe is not set.
  * @param pModules Collection of modules deployed with the given application
  * each item is of type {@link org.jboss.mgt.JBossModule
  * JBossModule}.
  **/
 public JBossApplication(
String pApplicationId,
String pDeploymentDescriptor,
Collection pModules
 ) {
mApplicationId = pApplicationId;
setDeploymentDescriptor( pDeploymentDescriptor );
mModules = pModules;
 }
  
 // -
 // Properties (Getters/Setters)
 // -  
  
 /**
  * @return Id of these Application
  **/
 public String getId() {
return mApplicationId;
 }
 
 /**
  * Returns the deployment descriptor
  *
  * @return Deployment Descriptor of this application which maybe is not set.
  **/
 public String getDeploymentDescriptor() {
return mDeploymentDescriptor;
 }
 
 /**
  * Sets the deployment descriptor
  *
  * @param pDeploymentDescriptor Deployment Descriptor of this application
  *  which maybe is not set.
  **/
 public void setDeploymentDescriptor( String pDeploymentDescriptor ) {
mDeploymentDescriptor = pDeploymentDescriptor;
 }
 
 /**
  * Adds a new Module
  *
  * @param pModule Module to be added
  **/
 public void addModule( JBossModule pModule ) {
mModules.add( pModule );
 }

 /**
  * Removes a Module
  *
  * @param pModule Module to be removed
  **/
 public void removeModule( JBossModule pModule ) {
mModules.remove( pModule );
 }
  
 /**
  * @return Collection of Modules deployed with this application. Each
  * item is of type {@link org.jboss.mgt.JBossModule JBossModule}.
  **/
 public Collection getModules() {
return mModules;
 }
  }
  
  
  
  1.1  jboss/src/main/org/jboss/mgt/JBossModule.java
  
  Index: JBossModule.java
  ===
  /*
   * JBoss, the OpenSource EJB server
   *
   * Distributable under LGPL license.
   * See terms of license at gnu.org.
   */
  package org.jboss.mgt;
  
  import java.util.Collection;
  
  /**
   * Contains the management information about
   * a deployed applications.
   *
   * @author Marc Fleury
   **/
  public class JBossModule {
 // -
 // Members
 // -  
  
 private String mModuleId;
 private String mDeploymentDescriptor;
 private Collection mItems;
  
 // -
 // Constructors
 // -
  
 /**
  * @param pModuleId Id of these module which must be unique within the 
application.
  * @param pDeploymentDescriptor Deployment Descriptor of this module
  * @param pItems Collection of Entities
  **/
 public JBossModule(
String

[JBoss-dev] CVS update: jboss/src/etc/conf/default jboss.jcml

2001-05-12 Thread schaefera

  User: schaefera
  Date: 01/05/12 20:34:20

  Modified:src/etc/conf/default jboss.jcml
  Log:
  First Draft for the JBoss management classes delivering the necessary
  information for a management tool to work with JBoss.
  
  Revision  ChangesPath
  1.30  +5 -0  jboss/src/etc/conf/default/jboss.jcml
  
  Index: jboss.jcml
  ===
  RCS file: /cvsroot/jboss/jboss/src/etc/conf/default/jboss.jcml,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- jboss.jcml2001/05/08 07:17:50 1.29
  +++ jboss.jcml2001/05/13 03:34:20 1.30
  @@ -389,6 +389,11 @@
 
   
 
  +  
  +  
  +  
  +
  +  
 
  
  
  

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



[JBoss-dev] CVS update: jboss/src/main/org/jboss/mgt - New directory

2001-05-12 Thread schaefera

  User: schaefera
  Date: 01/05/12 20:32:36

  jboss/src/main/org/jboss/mgt - New directory

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



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

2001-05-10 Thread schaefera

  User: schaefera
  Date: 01/05/10 15:01:17

  Modified:src/main/org/jboss/jmx/client ConnectorFactoryImpl.java
ConnectorFactoryService.java
  Log:
  Some minor fixes.
  
  Revision  ChangesPath
  1.7   +0 -6  jboss/src/main/org/jboss/jmx/client/ConnectorFactoryImpl.java
  
  Index: ConnectorFactoryImpl.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/jmx/client/ConnectorFactoryImpl.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ConnectorFactoryImpl.java 2001/05/04 21:18:05 1.6
  +++ ConnectorFactoryImpl.java 2001/05/10 22:01:17 1.7
  @@ -71,7 +71,6 @@
NamingEnumeration enum = lNamingServer.list( "" );
while( enum.hasMore() ) {
   NameClassPair lItem = ( NameClassPair ) enum.next();
  -System.out.println( "Naming Server item: " + lItem );
   ConnectorName lName = pTester.check( lItem.getName(), lItem.getClass() 
);
   if( lName != null ) {
  lConnectors.add( lName );
  @@ -111,7 +110,6 @@
   e.printStackTrace();
}
 }
  -  System.out.println( "ConnectorFactoryImpl.createConnection(), got connector: 
" + lConnector );
 return lConnector;
  }
   
  @@ -129,7 +127,6 @@
  new ObjectName( "DefaultDomain:name=RMIConnectorTo" + 
pConnector.getServer() ),
  null
   );
  -System.out.println( "ConnectorFactoryImpl.removeConnection(), got 
connectors: " + lConnectors );
   if( !lConnectors.isEmpty() ) {
  Iterator i = lConnectors.iterator();
  while( i.hasNext() ) {
  @@ -142,9 +139,6 @@
 );
 mServer.unregisterMBean(
lConnector.getObjectName()
  -  );
  -  System.out.println( "ConnectorFactoryImpl.removeConnection(), " +
  - "unregister MBean: " + lConnector.getObjectName()
 );
  }
   }
  
  
  
  1.6   +1 -5  jboss/src/main/org/jboss/jmx/client/ConnectorFactoryService.java
  
  Index: ConnectorFactoryService.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/jmx/client/ConnectorFactoryService.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ConnectorFactoryService.java  2001/05/04 21:18:06 1.5
  +++ ConnectorFactoryService.java  2001/05/10 22:01:17 1.6
  @@ -52,7 +52,6 @@
}

  public Iterator getConnectors( Hashtable pProperties, 
ConnectorFactoryImpl.IConnectorTester pTester ) {
  - System.out.println( "ConnectorFactoryService.getConnectors(), 
properties: " + pProperties );
return mFactory.getConnectors( pProperties, pTester );
  }
   
  @@ -86,10 +85,7 @@
// Protected -
protected void initService() throws Exception {
try {
  - System.out.println( "ConnectorFactoryService.initService(), server: " 
+ mServer );
  - mFactory = new ConnectorFactoryImpl( mServer );
  - System.out.println( "ConnectorFactoryService.initService(), server: " 
+ mServer +
  - ", factory: " + mFactory );
  + mFactory = new ConnectorFactoryImpl( mServer );
}
catch( Exception e ) {
e.printStackTrace();
  
  
  

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



[JBoss-dev] CVS update: jboss/src/main/test/jboss/jmx TestClient.java

2001-05-10 Thread schaefera

  User: schaefera
  Date: 01/05/10 14:58:00

  Modified:src/main/test/jboss/jmx TestClient.java
  Log:
  Using "Instance".getClass().getName() instead of writing down the classpath
  and name as a string.
  
  Revision  ChangesPath
  1.8   +9 -6  jboss/src/main/test/jboss/jmx/TestClient.java
  
  Index: TestClient.java
  ===
  RCS file: /cvsroot/jboss/jboss/src/main/test/jboss/jmx/TestClient.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- TestClient.java   2001/05/04 21:18:50 1.7
  +++ TestClient.java   2001/05/10 21:58:00 1.8
  @@ -6,6 +6,7 @@
   package test.jboss.jmx;
   
   import java.util.Collection;
  +import java.util.Hashtable;
   import java.util.Iterator;
   import java.util.Vector;
   
  @@ -96,16 +97,18 @@
catch( Exception e ) {
   e.printStackTrace();
}
  + Hashtable lProperties = lContext.getEnvironment();
  + ConnectorFactoryImpl.JBossConnectorTester lTester = new 
ConnectorFactoryImpl.JBossConnectorTester();
Iterator lConnectors = (Iterator) lLocalServer.invoke(
lFactoryInstance.getObjectName(),
"getConnectors",
new Object[] {
  - lContext.getEnvironment(),
  -   new ConnectorFactoryImpl.JBossConnectorTester()
  + lProperties,
  +   lTester
},
new String[] {
  - "java.util.Hashtable",
  -   "org.jboss.jmx.client.ConnectorFactoryImpl$IConnectorTester"
  +   lProperties.getClass().getName(),
  +   lTester.getClass().getName()
}
);
int lCount = 0;
  @@ -148,7 +151,7 @@
lConnectorName
},
new String[] {
  - 
"org.jboss.jmx.client.ConnectorFactoryImpl$ConnectorName"
  +   lConnectorName.getClass().getName()
}
);
getUserInput(
  @@ -183,7 +186,7 @@

lConnectorName
},
new String[] {
  -  
"org.jboss.jmx.client.ConnectorFactoryImpl$ConnectorName"
  +  lConnectorName.getClass().getName()
}
);

System.err.println("Shutting done");
  
  
  

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



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

2001-05-04 Thread schaefera

  User: schaefera
  Date: 01/05/04 14:18:06

  Modified:src/main/org/jboss/jmx/client ConnectorFactoryImpl.java
ConnectorFactoryService.java
ConnectorFactoryServiceMBean.java
  Log:
  Revamp the Connector Factory allowing the client to look for JMX Connectors
  in a more general way. The getServers() and getProtocols() is replaced by
  getConnectors() returning a list of Connectors delivered from the specified
  JNDI server (found by the specified Connector Tester instance).
  
  Revision  ChangesPath
  1.6   +230 -210  jboss/src/main/org/jboss/jmx/client/ConnectorFactoryImpl.java
  
  Index: ConnectorFactoryImpl.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/jmx/client/ConnectorFactoryImpl.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ConnectorFactoryImpl.java 2000/12/07 18:16:11 1.5
  +++ ConnectorFactoryImpl.java 2001/05/04 21:18:05 1.6
  @@ -9,6 +9,7 @@
   
   import java.util.Arrays;
   import java.util.Collection;
  +import java.util.Hashtable;
   import java.util.Iterator;
   import java.util.Set;
   import java.util.StringTokenizer;
  @@ -26,216 +27,235 @@
   import org.jboss.jmx.interfaces.JMXConnector;
   
   /**
  -* 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
  -*
  -* @author mailto:[EMAIL PROTECTED]";>Andreas "Mad" 
Schaefer
  -**/
  + * 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
  + *
  + *@authormailto:[EMAIL PROTECTED]";>Andreas
  + *  "Mad" Schaefer
  + *@created   May 2, 2001
  + **/
   public class ConnectorFactoryImpl {
   
  - // Constants -
  - 
  - // Static 
  -
  - // Attributes 
  - /** Server this factory is registered at **/
  - private MBeanServer mServer;
  -
  - // Public 
  - 
  - public ConnectorFactoryImpl(
  - MBeanServer pServer
  - ) {
  - mServer = pServer;
  - }
  - 
  - /**
  - * Returns a list of available servers
  - *
  - * @param pProtocol  Servers supporting this protocol if 
not null
  - *   or empty otherwise it 
will be ignored
  - * @param pServerQuery   Query instance to filter the list of servers
  - *
  - * @return   A collection of available 
servers
  - *   names/identifications 
(String)
  - **/
  - public Collection getServers(
  - String pProtocol
  -//AS ServerQuery pServerQuery
  - ) {
  - System.out.println( "ConnectorFactoryImpl.getServers(), protocol: " + 
pProtocol );
  - // Check if there is a protocol given to query for
  - boolean lProtocolQuery = pProtocol != null && pProtocol.length() > 0;
  - // Get all available connectors from the JNDI server
  - Iterator lConnectors = getConnectorList();
  - Vector lServers = new Vector();
  - // Go through the connectors list and check if part of the list
  - while( lConnectors.hasNext() ) {
  - ConnectorObject lConnector = (ConnectorObject) 
lConnectors.next();
  - if( !lProtocolQuery || 
lConnector.getProtocol().equalsIgnoreCase( pProtocol ) ) {
  - lServers.add( lConnector.getServer() );
  - }
  - }
  - return lServers;
  - }
  - 
  - /**
  - * Returns a list of available protocols (connectors)
  - *
  - * @param pServerServer name/identification to look up 
if not
  - *   null or empty 
otherwise it will be ignored
  - *
  - * @return   A collection of available 
protocols (String)
  - **/
  - public Collection getProtocols(
  - String pServer
  - ) {
  - // Check if there is a protocol given to query for
  - boolean lServerQuery = pServer != null && pServer.length() > 0;
  - // Get all available connectors from the JNDI server
  - Iterator lConnectors = getConnectorList();
  - Vector lPr

[JBoss-dev] CVS update: jboss/src/main/test/jboss/jmx TestClient.java

2001-05-04 Thread schaefera

  User: schaefera
  Date: 01/05/04 14:18:50

  Modified:src/main/test/jboss/jmx TestClient.java
  Log:
  Adjusted to the changes in the Connector Factory.
  
  Revision  ChangesPath
  1.7   +33 -60jboss/src/main/test/jboss/jmx/TestClient.java
  
  Index: TestClient.java
  ===
  RCS file: /cvsroot/jboss/jboss/src/main/test/jboss/jmx/TestClient.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TestClient.java   2000/12/07 18:16:15 1.6
  +++ TestClient.java   2001/05/04 21:18:50 1.7
  @@ -7,6 +7,7 @@
   
   import java.util.Collection;
   import java.util.Iterator;
  +import java.util.Vector;
   
   import javax.management.MBeanAttributeInfo;
   import javax.management.MBeanException;
  @@ -25,8 +26,9 @@
   import javax.management.RuntimeOperationsException;
   import javax.naming.InitialContext; 
   
  -import org.jboss.jmx.interfaces.JMXConnector;
  +import org.jboss.jmx.client.ConnectorFactoryImpl;
   import org.jboss.jmx.client.RMIClientConnectorImpl;
  +import org.jboss.jmx.interfaces.JMXConnector;
   
   /**
   * Test Client for the JMX Client Connector. It cretes a local MBeanServer and
  @@ -83,83 +85,58 @@
);
getUserInput(
"\n" +
  - "2. Lookup for all available servers on your 
network\n" +
  + "2. Lookup for all available connectors with the JNDI 
defined by jndi.properties\n" +
"=> hit any key to proceed"
);
  - // Now let's list the available servers, protocols
  - Collection lServers = (Collection) lLocalServer.invoke(
  + // Now let's list the available JMX Connectors
  + InitialContext lContext = null;
  + try {
  +lContext = new InitialContext();
  + }
  + catch( Exception e ) {
  +e.printStackTrace();
  + }
  + Iterator lConnectors = (Iterator) lLocalServer.invoke(
lFactoryInstance.getObjectName(),
  - "getServers",
  + "getConnectors",
new Object[] {
  - null
  + lContext.getEnvironment(),
  +   new ConnectorFactoryImpl.JBossConnectorTester()
},
new String[] {
  - "java.lang.String"
  + "java.util.Hashtable",
  +   "org.jboss.jmx.client.ConnectorFactoryImpl$IConnectorTester"
}
);
  - Iterator i = lServers.iterator();
int lCount = 0;
StringBuffer lMessage = new StringBuffer();
  - lMessage.append( "List of all available servers on your net\n" 
);
  + lMessage.append( "List of all available connectors on your 
net\n" );
lMessage.append( "=\n" 
);
  - while( i.hasNext() ) {
  - lMessage.append( " - " + ( lCount++ ) + ". server is: 
" + i.next() + "\n" );
  + Vector lTemp = new Vector();
  + while( lConnectors.hasNext() ) {
  +ConnectorFactoryImpl.ConnectorName lName = 
(ConnectorFactoryImpl.ConnectorName) lConnectors.next();
  +lTemp.addElement( lName );
  + lMessage.append( " - " + ( lCount++ ) + ". connector 
is: " + lName + "\n" );
}
lMessage.append( "\n" );
  - lMessage.append( "3. Select your server by entering its 
number\n" );
  + lMessage.append( "3. Select your connector by entering its 
number\n" );
lMessage.append( "=> hit any key to proceed" );
int lChoice = getUserInput( lMessage.toString() );
  - i = lServers.iterator();
  + Iterator i = lTemp.iterator();
lCount = 0;
while( i.hasNext() ) {
if( ( lCount++ ) == lChoice ) {
break;
}
}
  - final String lServer = i.next() + "";
  + final ConnectorFactoryImp

[JBoss-dev] CVS update: jboss/src/etc connector.mf

2001-05-04 Thread schaefera

  User: schaefera
  Date: 01/05/04 14:14:47

  Modified:src/etc  connector.mf
  Log:
  Added the log4j.jar file (in ../lib/ext) to the classpath
  
  Revision  ChangesPath
  1.3   +1 -1  jboss/src/etc/connector.mf
  
  Index: connector.mf
  ===
  RCS file: /cvsroot/jboss/jboss/src/etc/connector.mf,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- connector.mf  2000/12/07 18:16:07 1.2
  +++ connector.mf  2001/05/04 21:14:47 1.3
  @@ -1,2 +1,2 @@
   Main-Class: test.jboss.jmx.TestClient
  -Class-Path: ./ ../conf/ ./jmxri.jar ../lib/jmxri.jar ./jnp-client.jar 
../lib/jnp-client.jar
  +Class-Path: ./ ../conf/ ./jmxri.jar ../lib/jmxri.jar ./jnp-client.jar 
../lib/jnp-client.jar ../lib/ext/log4j.jar
  
  
  

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



[JBoss-dev] CVS update: jboss/src/build build.xml

2001-05-04 Thread schaefera

  User: schaefera
  Date: 01/05/04 14:14:03

  Modified:src/build build.xml
  Log:
  Add Log4J to Connector Jar File (added to ServiceMBean).
  
  Revision  ChangesPath
  1.72  +1 -1  jboss/src/build/build.xml
  
  Index: build.xml
  ===
  RCS file: /cvsroot/jboss/jboss/src/build/build.xml,v
  retrieving revision 1.71
  retrieving revision 1.72
  diff -u -r1.71 -r1.72
  --- build.xml 2001/04/30 14:14:29 1.71
  +++ build.xml 2001/05/04 21:14:03 1.72
  @@ -253,7 +253,7 @@
   
   
   
  
  
  

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