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 Changes Path
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
// -------------------------------------------------------------------------
/**
* @param pName Name of the Item
**/
public Item(
String pName
) {
mName = pName;
}
// -------------------------------------------------------------------------
// Properties (Getters/Setters)
// -------------------------------------------------------------------------
/**
* @return Name of these Item
**/
public String getName() {
return mName;
}
public String toString() {
return "Item [ " + getName() + " ]";
}
}
1.1 jboss/src/main/org/jboss/mgt/Servlet.java
Index: Servlet.java
===================================================================
/*
* JBoss, the OpenSource EJB server
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package org.jboss.mgt;
import java.util.Map;
/**
* Contains the management information about a Servlet
*
* @author Andreas "Mad" Schaefer ([EMAIL PROTECTED])
**/
public class Servlet
extends Item
{
// -------------------------------------------------------------------------
// Members
// -------------------------------------------------------------------------
private String mClass;
private Map mParameters;
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
/**
* @param pName Name of the Servlet
* @param pClassName Name of the class the servlet is based on
* @param pParameters Map of the Servlet Parameters
**/
public Servlet(
String pName,
String pClassName,
Map pParameters
) {
super( pName );
mClass = pClassName;
mParameters = pParameters;
}
// -------------------------------------------------------------------------
// Properties (Getters/Setters)
// -------------------------------------------------------------------------
/**
* @return Class of the Servlet is based on
**/
public String getClassName() {
return mClass;
}
/**
* @return Map of the Servlet Parameters where the key
* is the Name and the value is the Value of
* the parameter
**/
public Map getParameters() {
return mParameters;
}
public String toString() {
return "Servlet [ " + getName() +
", " + getClassName() +
", " + getParameters() +
" ]";
}
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development