geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From de...@apache.org
Subject svn commit: r881851 - in /geronimo/sandbox/delos: ./ src/ src/java/ src/java/main/ src/java/main/org/ src/java/main/org/apache/ src/java/main/org/apache/geronimo/ src/java/main/org/apache/geronimo/mbean/ src/java/main/org/apache/geronimo/mbean/webexten...
Date Wed, 18 Nov 2009 17:52:13 GMT
Author: delos
Date: Wed Nov 18 17:52:12 2009
New Revision: 881851

URL: http://svn.apache.org/viewvc?rev=881851&view=rev
Log:
mbean defined for Web extender per OSGI RFC 66 

Added:
    geronimo/sandbox/delos/
    geronimo/sandbox/delos/doc.zip   (with props)
    geronimo/sandbox/delos/pom.xml
    geronimo/sandbox/delos/src/
    geronimo/sandbox/delos/src/java/
    geronimo/sandbox/delos/src/java/main/
    geronimo/sandbox/delos/src/java/main/org/
    geronimo/sandbox/delos/src/java/main/org/apache/
    geronimo/sandbox/delos/src/java/main/org/apache/geronimo/
    geronimo/sandbox/delos/src/java/main/org/apache/geronimo/mbean/
    geronimo/sandbox/delos/src/java/main/org/apache/geronimo/mbean/webextender/
    geronimo/sandbox/delos/src/java/main/org/apache/geronimo/mbean/webextender/WebExtenderMbean.java

Added: geronimo/sandbox/delos/doc.zip
URL: http://svn.apache.org/viewvc/geronimo/sandbox/delos/doc.zip?rev=881851&view=auto
==============================================================================
Binary file - no diff available.

Propchange: geronimo/sandbox/delos/doc.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: geronimo/sandbox/delos/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/delos/pom.xml?rev=881851&view=auto
==============================================================================
--- geronimo/sandbox/delos/pom.xml (added)
+++ geronimo/sandbox/delos/pom.xml Wed Nov 18 17:52:12 2009
@@ -0,0 +1,18 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.geronimo.mbean</groupId>
+  <artifactId>org.apache.geronimo.mbean.webextender</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0-SNAPSHOT</version>
+  
+  <name>org.apache.geronimo.mbean.webextender</name>
+  
+  <dependencies>
+    <dependency>
+      <groupId>org.osgi</groupId>
+      <artifactId>org.osgi.jmx</artifactId>
+      <version>1.0</version>
+    </dependency>
+  </dependencies>
+</project>

Added: geronimo/sandbox/delos/src/java/main/org/apache/geronimo/mbean/webextender/WebExtenderMbean.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/delos/src/java/main/org/apache/geronimo/mbean/webextender/WebExtenderMbean.java?rev=881851&view=auto
==============================================================================
--- geronimo/sandbox/delos/src/java/main/org/apache/geronimo/mbean/webextender/WebExtenderMbean.java
(added)
+++ geronimo/sandbox/delos/src/java/main/org/apache/geronimo/mbean/webextender/WebExtenderMbean.java
Wed Nov 18 17:52:12 2009
@@ -0,0 +1,332 @@
+package org.apache.geronimo.mbean.webextender;
+
+import javax.management.openmbean.CompositeData;
+import javax.management.openmbean.CompositeType;
+import javax.management.openmbean.SimpleType;
+import javax.management.openmbean.TabularData;
+import javax.management.openmbean.TabularType;
+
+import org.osgi.jmx.Item;
+
+/**
+ * This class is a standard mbean. It's used to monitor Web extender in OSGI framework.
+ * The extender is implemented per the OSGI document RFC 66 "OSGI and Web Applications".
+ * In general, extender will 
+ * 
+ * <ol type="1">
+ *  <li> adapt  Web containers to OSGI framework</li>
+ *  <li> convert a WAR into WAB with an URLHandler </li>
+ *  <li> monitor the status of an deployed WAB by predefined event</li>
+ * </ol>
+ * The purpose of this mbean is to monitor information of extender, which is derived from
the document. It doesn't
+ * contains information dedicated for Web container and OSGI bundle, such as servlet list
or bundle dependencies.
+ * Here are two reasons for excluding these information
+ * 
+ * <ol type="1">
+ * 	<li> existence of a large number of mbeans in normal Web container, such as Tomcat
and Jetty, so the mbean just
+ *    focus on extender itself without taking information of Web container into account.
</li>
+ * 	<li> in RFC 139, several mbeans are defined to monitor various information of a
normal OSGI bundle, so it's unnecessary
+ *    to define the information for an OSGI bundle here.</li>
+ * </ol>
+ *    
+ * @author Delos
+ *
+ */
+
+public interface WebExtenderMbean {
+	/**
+	 * The key IDENTIFIER, used in {@link #IDENTIFIER_ITEM}.
+	 */
+	String IDENTIFIER = "IDENTIFIER";
+	/**
+	 * The item containing the bundle identifier in {@link #WAB_EVENT_TYPE}. The
+	 * key is {@link #IDENTIFIER} and the the type is {@link SimpleType#LONG}.
+	 */
+	Item IDENTIFIER_ITEM = new Item(IDENTIFIER, "The id of the bundle",
+			SimpleType.LONG);
+	
+	/**
+	 * The key VERSION, used in {@link #VERSION_ITEM}.
+	 */
+	String VERSION = "VERSION";
+	/**
+	 * The item containing the bundle version in {@link #WAB_EVENT_TYPE}. The key
+	 * is {@link #VERSION} and the the type is {@link SimpleType#STRING}.
+	 */
+	Item VERSION_ITEM = new Item(VERSION, "The version of the bundle",
+			SimpleType.STRING);
+	
+	/**
+	 * The key SYMBOLIC_NAME, used in {@link #SYMBOLIC_NAME_ITEM}.
+	 */
+	String SYMBOLIC_NAME = "SymbolicName";
+
+	/**
+	 * The item containing the symbolic name in {@link #WAB_EVENT_TYPE}. The key is
+	 * {@link #SYMBOLIC_NAME} and the the type is {@link SimpleType#STRING}.
+	 */
+	Item SYMBOLIC_NAME_ITEM = new Item(SYMBOLIC_NAME,
+			"The symbolic name of the bundle", SimpleType.STRING);
+	
+	/**
+	 * The key CONTEXTPATH, used in {@link #CONTEXTPATH_ITEM}.
+	 */
+	String CONTEXTPATH = "CONTEXTPATH";
+
+	/**
+	 * The item containing the context path  in {@link #WAB_EVENT_TYPE}. The key is
+	 * {@link #CONTEXTPATH} and the the type is {@link SimpleType#STRING}.
+	 */
+	Item CONTEXTPATH_ITEM = new Item(CONTEXTPATH,
+			"The context path of the bundle", SimpleType.STRING);
+	
+	/**
+	 * The key TIMESTAMP, used in {@link #TIMESTAMP_ITEM}.
+	 */
+	String TIMESTAMP = "TIMESTAMP";
+
+	/**
+	 * The item containing the timestamp  in {@link #WAB_EVENT_TYPE}. The key is
+	 * {@link #TIMESTAMP} and the the type is {@link SimpleType#STRING}.
+	 */
+	Item TIMESTAMP_ITEM = new Item(TIMESTAMP,
+			"The timestamp of the bundle", SimpleType.STRING);
+	
+	/**
+	 * The key EXTENDER_ID, used in {@link #EXTENDER_ID_ITEM}.
+	 */
+	String EXTENDER_ID = "EXTENDER_ID";
+
+	/**
+	 * The item containing the extender bundle id  in {@link #WAB_EVENT_TYPE}. The key is
+	 * {@link #EXTENDER_ID} and the the type is {@link SimpleType#STRING}.
+	 */
+	Item EXTENDER_ID_ITEM = new Item(EXTENDER_ID,
+			"The extender bundle id of the bundle", SimpleType.STRING);
+	
+	/**
+	 * The key EXTENDER_SYMBOLIC_NAME, used in {@link #EXTENDER_SYMBOLIC_NAME_ITEM}.
+	 */
+	String EXTENDER_SYMBOLIC_NAME = "EXTENDER_SYMBOLIC_NAME";
+
+	/**
+	 * The item containing the extender bundle symbolic name in {@link #WAB_EVENT_TYPE}. The
key is
+	 * {@link #EXTENDER_SYMBOLIC_NAME} and the the type is {@link SimpleType#STRING}.
+	 */
+	Item EXTENDER_SYMBOLIC_NAME_ITEM = new Item(EXTENDER_SYMBOLIC_NAME,
+			"The extender bundle symbolic name of the bundle", SimpleType.STRING);
+	
+	/**
+	 * The key EXTENDER_VERSION, used in {@link #EXTENDER_VERSION_ITEM}.
+	 */
+	String EXTENDER_VERSION = "EXTENDER_VERSION";
+
+	/**
+	 * The item containing the extender bundle version in {@link #WAB_EVENT_TYPE}. The key is
+	 * {@link #EXTENDER_VERSION} and the the type is {@link SimpleType#STRING}.
+	 */
+	Item EXTENDER_VERSION_ITEM = new Item(EXTENDER_VERSION,
+			"The extender bundle version of the bundle", SimpleType.STRING);
+	
+	/**
+	 * The key EXCEPTION_MESSAGE, used in {@link #EXCEPTION_MESSAGE_ITEM}.
+	 */
+	String EXCEPTION_MESSAGE = "WABEvent";
+
+	/**
+	 * The item containing the exception message for a FAILED event in {@link #WAB_EVENT_TYPE}.
 The key is {@link #EXCEPTION_MESSAGE} and the type is {@link SimpleType#INTEGER}
+	 */
+	Item EXCEPTION_MESSAGE_ITEM = new Item(
+			EXCEPTION_MESSAGE,
+			"The exception message when extender failed to deploy a WAB",
+			SimpleType.STRING);
+	
+	/**
+	 * The key EVENT, used in {@link #EVENT_ITEM}.
+	 */
+	String EVENT = "WABEvent";
+
+	/**
+	 * The item containing the event type.  The key is {@link #EVENT} and the type is {@link
SimpleType#INTEGER}
+	 */
+	Item EVENT_ITEM = new Item(
+			EVENT,
+			"The type of the event: {DEPLOYING=1, DEPLOYED=2, UNDEPLOYING=4, UNDEPLOYED=8, FAILED=16}",
+			SimpleType.INTEGER);
+	
+	
+	
+	/**
+	 * The Composite Type that represents a bundle event.  This composite consists of:
+	 * <ul>
+	 * <li>{@link #CONTEXTPATH_ITEM}</li>
+	 * <li>{@link #EVENT_ITEM}</li>
+	 * <li>{@link #EXTENDER_ID_ITEM}</li>
+	 * <li>{@link #EXTENDER_SYMBOLIC_NAME_ITEM}</li>
+	 * <li>{@link #EXTENDER_VERSION_ITEM}</li>
+	 * <li>{@link #IDENTIFIER_ITEM}</li>
+	 * <li>{@link #SYMBOLIC_NAME_ITEM}</li>
+	 * <li>{@link #TIMESTAMP_ITEM}</li>
+	 * <li>{@link #VERSION_ITEM}</li> 
+	 * </ul>
+	 */
+	CompositeType WAB_EVENT_TYPE = Item.compositeType("WAB_EVENT",
+			"This type encapsulates WAB bundle events", 
+			CONTEXTPATH_ITEM,
+			EVENT_ITEM,
+			EXTENDER_ID_ITEM,
+			EXTENDER_SYMBOLIC_NAME_ITEM,
+			EXTENDER_VERSION_ITEM,
+			IDENTIFIER_ITEM,
+			SYMBOLIC_NAME_ITEM,
+			TIMESTAMP_ITEM, 
+			VERSION_ITEM);
+	
+	
+	/**
+	 * The Tabular Type describing the type of the Tabular Data value that is
+	 * returned from {@link #getEvents(long)} method. The primary item is
+	 * {@link #EVENT_ITEM}.
+	 */
+	TabularType HEADERS_TYPE = Item.tabularType("HEADERS",
+			"The table of WAB events", WAB_EVENT_TYPE, new String[] { EVENT });
+	
+	
+	//Web container
+	
+	/**
+	 * Return the extender bundle id 
+	 * 
+	 * @return Return the extender bundle id
+	 */
+	public long getWebExtenderId();
+	
+	/**
+	 * In OSGI environment, Web container may be replaced dynamically in OSGI environment.
+	 * This method returns the bundle id for the Web container currently used.
+	 * 
+	 * @return the bundle id for the Web container currently used
+	 * 
+	 */
+	public long getCurrentWebContainerId();
+	
+	/**
+	 * In OSGI environment, Web container may be replaced dynamically in OSGI environment.
+	 * This method returns available Web containers in current framework.
+	 * 
+	 * @return the id list of all the available Web containers in current framework
+	 */
+	public long[] getWebContainerIds();
+	
+	/**
+	 * Check whether the Web container with specified id is available in current framework
+	 * 
+	 * @param containerId - the bundle id for the Web container
+	 * @return true if the container is available; otherwise, return false
+	 */
+	public boolean isContainerAvailable(String containerId);
+	
+	//URL handler
+	/**
+	 * In OSGI environment, URLHandler is used to convert a WAR into a WAB in OSGI environment.
There may be several 
+	 * URLHanlders available. URLHandler is registered as an OSGI service.
+	 * 
+	 * This method returns the id list of all the available URLHanlders 
+	 * 
+	 * @return  the service id list of all the available URLHanlders 
+	 * 
+	 * 
+	 */
+	public long[] getURLHandlerIds();
+	
+	/**
+	 * This method returns the id of URLHanlder currently used 
+	 * 
+	 * @return  the service id of all the available URLHanlders 
+	 * 
+	 */
+	public long getCurrentURLHanlderId();
+
+
+	//WAB
+	/**
+	 * In OSGI environment, a WAR can also be deployed in an OSGI Web container.
+	 * But a WAR has to be converted into a WAB first.
+	 * 
+	 * This method check whether specified WAB is converted from a WAR.
+	 * 
+	 * @param wabId - the id of wab
+	 * @return return true if the WAB is converted from a WAR;otherwise, return false
+	 */
+	public boolean isConvertedWAB(String wabId);
+	
+	
+	/**
+	 * Get the id list of all the deployed WAB
+	 *  
+	 * @return the bundle id of all the deployed WABs
+	 */
+	public long[] getDeployedWABIds();
+	
+	/**
+	 * Get the id list of all the WABs that are being deployed
+	 *  
+	 * @return the bundle id of all the WABs that are being deployed
+	 */
+	public long[] getDeployingWABIds();
+	
+	/**
+	 * Get the id list of all the WABs that are failed to be deployed 
+	 *  
+	 * @return the bundle id of all the WABs that are failed to be deployed
+	 */
+	public long[] getFailedWABIds();
+	
+	/**
+	 * 
+	 * There are several events during the life-cycle of a WAB.
+	 * 
+	 * This method returns the latest event happened to the WAB.
+	 * 
+	 * The CompositeData is typed by the {@link #WAB_EVENT_TYPE}.
+	 * 
+	 * @param wabId - the bundle id of a WAB
+	 *  
+	 * @return the name of last event happened to the WAB 
+	 */
+	public  CompositeData getEvents(String wabId);
+	
+	/**
+	 * 
+	 * There are several events during the life-cycle of a WAB.
+	 * 
+	 * This method returns all the event that has happened to the WAB.
+	 * 
+	 * The TabularData is typed by the {@link #WAB_EVENT_TYPE}.
+	 * 
+	 * @param wabId - the  id of a WAB
+	 *  
+	 * @return the name of last event happened to the WAB 
+	 */
+	public TabularData getLastEvents();
+	
+	
+	/**
+	 * Check whether WAB with specified id contains the annotation in code.That means
+	 * code scan is needed.It's determined by the value of "metadata-complete" in descriptor.
+	 * 
+	 * @param wabId - the bundle id of a WAB
+	 *  
+	 * @return true if the WAB contains annotation;otherwise,return false;
+	 */
+	public boolean containsAnnotation(String wabId);
+	
+	/**
+	 * Get the context path of the WAB with specified id
+	 * 
+	 * @param wabId - the bundle id of a WAB
+	 *  
+	 * @return the context path of the WAB 
+	 */
+	public String getContextPath(String wabId);
+}



Mime
View raw message