Skip to Content.
Sympa Menu

notify-dpml - r1784 - in trunk: central central/site/etc/docs central/site/etc/docs/images/transit central/site/src/docs/about/download central/site/src/docs/transit/cli main/depot main/depot/core main/depot/core/src/main/net/dpml/depot main/depot/tools/src/main/net/dpml/tools main/depot/tools/src/main/net/dpml/tools/impl main/depot/tools/src/main/net/dpml/tools/tasks main/metro main/metro/runtime/src/main/net/dpml/metro/runtime main/metro/runtime/src/test/net/dpml/metro/runtime main/planet main/station main/station/console/etc/bin main/station/server/src/main/net/dpml/station/server main/transit main/transit/core main/transit/core/src/main/net/dpml/lang main/transit/core/src/main/net/dpml/transit main/transit/core/src/main/net/dpml/util main/transit/jmx main/transit/jmx/src main/transit/jmx/src/main main/transit/jmx/src/main/net main/transit/jmx/src/main/net/dpml main/transit/jmx/src/main/net/dpml/transit main/transit/jmx/src/main/net/dpml/transit/management

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell at BerliOS <mcconnell AT mail.berlios.de>
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: r1784 - in trunk: central central/site/etc/docs central/site/etc/docs/images/transit central/site/src/docs/about/download central/site/src/docs/transit/cli main/depot main/depot/core main/depot/core/src/main/net/dpml/depot main/depot/tools/src/main/net/dpml/tools main/depot/tools/src/main/net/dpml/tools/impl main/depot/tools/src/main/net/dpml/tools/tasks main/metro main/metro/runtime/src/main/net/dpml/metro/runtime main/metro/runtime/src/test/net/dpml/metro/runtime main/planet main/station main/station/console/etc/bin main/station/server/src/main/net/dpml/station/server main/transit main/transit/core main/transit/core/src/main/net/dpml/lang main/transit/core/src/main/net/dpml/transit main/transit/core/src/main/net/dpml/util main/transit/jmx main/transit/jmx/src main/transit/jmx/src/main main/transit/jmx/src/main/net main/transit/jmx/src/main/net/dpml main/transit/jmx/src/main/net/dpml/transit main/transit/jmx/src/main/net/dpml/transit/management
  • Date: Sat, 18 Nov 2006 18:46:47 +0100

Author: mcconnell
Date: 2006-11-18 18:46:43 +0100 (Sat, 18 Nov 2006)
New Revision: 1784

Added:
trunk/central/site/etc/docs/images/transit/transit-jmx.png
trunk/main/depot/tools/src/main/net/dpml/tools/BuildError.java
trunk/main/transit/jmx/
trunk/main/transit/jmx/src/
trunk/main/transit/jmx/src/main/
trunk/main/transit/jmx/src/main/net/
trunk/main/transit/jmx/src/main/net/dpml/
trunk/main/transit/jmx/src/main/net/dpml/transit/
trunk/main/transit/jmx/src/main/net/dpml/transit/management/

trunk/main/transit/jmx/src/main/net/dpml/transit/management/HostController.java

trunk/main/transit/jmx/src/main/net/dpml/transit/management/HostControllerMXBean.java

trunk/main/transit/jmx/src/main/net/dpml/transit/management/LayoutController.java

trunk/main/transit/jmx/src/main/net/dpml/transit/management/LayoutControllerMXBean.java

trunk/main/transit/jmx/src/main/net/dpml/transit/management/TransitController.java

trunk/main/transit/jmx/src/main/net/dpml/transit/management/TransitControllerMXBean.java
Modified:
trunk/central/module.xml
trunk/central/site/etc/docs/.htaccess
trunk/central/site/src/docs/about/download/archive.xml
trunk/central/site/src/docs/transit/cli/index.xml
trunk/main/depot/core/build.xml
trunk/main/depot/core/src/main/net/dpml/depot/Main.java
trunk/main/depot/module.xml
trunk/main/depot/tools/src/main/net/dpml/tools/impl/StandardBuilder.java
trunk/main/depot/tools/src/main/net/dpml/tools/tasks/JavacTask.java
trunk/main/depot/tools/src/main/net/dpml/tools/tasks/PackageTask.java
trunk/main/depot/tools/src/main/net/dpml/tools/tasks/PartTask.java
trunk/main/metro/module.xml

trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/CompositionController.java

trunk/main/metro/runtime/src/test/net/dpml/metro/runtime/DefaultStateMachineTestCase.java
trunk/main/planet/module.xml
trunk/main/station/console/etc/bin/station.lap
trunk/main/station/module.xml

trunk/main/station/server/src/main/net/dpml/station/server/StationServerPlugin.java
trunk/main/transit/core/build.xml
trunk/main/transit/core/src/main/net/dpml/lang/PartDecoder.java
trunk/main/transit/core/src/main/net/dpml/lang/StandardClassLoader.java
trunk/main/transit/core/src/main/net/dpml/transit/DTDResolver.java
trunk/main/transit/core/src/main/net/dpml/transit/DefaultTransitModel.java
trunk/main/transit/core/src/main/net/dpml/transit/Transit.java
trunk/main/transit/core/src/main/net/dpml/transit/TransitBuilder.java
trunk/main/transit/core/src/main/net/dpml/util/EventQueue.java
trunk/main/transit/module.xml
Log:
1. Addition of the transit jmx project and updates to the station to trigger
jmx-based invocation when running under SE6.
2. Updating modules to replace a 1.0.4 distribution.
3. Resolution of a series of minor issues while testing under the SE6 RC.

Modified: trunk/central/module.xml
===================================================================
--- trunk/central/module.xml 2006-11-12 15:35:19 UTC (rev 1783)
+++ trunk/central/module.xml 2006-11-18 17:46:43 UTC (rev 1784)
@@ -25,6 +25,7 @@
<feature token="ANT-JAR-VERSION" ref="ant/ant" id="version"/>
<feature token="ANT-JAR-URI" ref="ant/ant" id="uri" type="jar" />
<feature token="TRANSIT-TOOLS-URI"
ref="dpml/transit/dpml-transit-tools" id="uri" type="jar" />
+ <feature token="TRANSIT-CLI-URI"
ref="dpml/transit/dpml-transit-console" id="uri" type="jar" />
<feature token="TRANSIT-MODULE-VERSION" ref="dpml/transit"
id="version"/>
<feature token="TRANSIT-HANDLER-URI"
ref="dpml/transit/dpml-transit-main" id="uri" type="jar" />
<feature token="DEPOT-MODULE-VERSION" ref="dpml/depot" id="version" />

Modified: trunk/central/site/etc/docs/.htaccess
===================================================================
--- trunk/central/site/etc/docs/.htaccess 2006-11-12 15:35:19 UTC (rev
1783)
+++ trunk/central/site/etc/docs/.htaccess 2006-11-18 17:46:43 UTC (rev
1784)
@@ -13,7 +13,7 @@
RedirectMatch ^/about/setup(.*) http://www.dpml.net/about/download/index.html
RedirectMatch ^/index.html http://www.dpml.net/about/index.html
RedirectMatch ^/index.htm http://www.dpml.net/about/index.html
-RedirectMatch ^/metro/station/cli(.*) http://www.dpml.net/station/cli
+RedirectMatch ^/metro/station/* http://www.dpml.net/station/index.html
RedirectMatch ^/milestones/* http://download.dpml.net/milestones/index.html
RedirectMatch ^/dpml/1.0.0-1692/*
http://api.dpml.net/dpml/@VERSION@/index.html
RedirectMatch ^/dpml/1.0.0-RC* http://api.dpml.net/dpml/@VERSION@/index.html

Added: trunk/central/site/etc/docs/images/transit/transit-jmx.png
===================================================================
(Binary files differ)


Property changes on:
trunk/central/site/etc/docs/images/transit/transit-jmx.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream

Modified: trunk/central/site/src/docs/about/download/archive.xml
===================================================================
--- trunk/central/site/src/docs/about/download/archive.xml 2006-11-12
15:35:19 UTC (rev 1783)
+++ trunk/central/site/src/docs/about/download/archive.xml 2006-11-18
17:46:43 UTC (rev 1784)
@@ -17,6 +17,67 @@
The following table lists formal distributions published by the DPML.
</p>

+ <subsection name="Version @VERSION@">
+
+ <p>
+ Resolved issues and/or enhancements:
+ </p>
+
+ <p>
+ Version @VERSION@ is a maintenance update the resolves a number of
+ issues identified while testing under SE6 (RC), together with a
number
+ of minor internal enhancements.
+ </p>
+
+ <table>
+ <tr>
+ <td>Windows NSIS Installer</td>
+ <td>
+ <a
href="http://download.dpml.net/formal/sdk/@VERSION@/dpml-sdk-win32-@VERSION@.exe";>
+ dpml-sdk-win32-@VERSION@.exe</a>
+ </td>
+ <td>
+ <a
href="http://download.dpml.net/formal/sdk/@VERSION@/dpml-sdk-win32-@VERSION@.exe.md5";>
+ MD5</a>
+ </td>
+ </tr>
+ <tr>
+ <td>Windows Zip Archive</td>
+ <td>
+ <a
href="http://download.dpml.net/formal/sdk/@VERSION@/dpml-sdk-win32-@VERSION@.zip";>
+ dpml-sdk-win32-@VERSION@.zip</a>
+ </td>
+ <td>
+ <a
href="http://download.dpml.net/formal/sdk/@VERSION@/dpml-sdk-win32-@VERSION@.zip.md5";>
+ MD5</a>
+ </td>
+ </tr>
+ <tr>
+ <td>Linux Archive</td>
+ <td>
+ <a
href="http://download.dpml.net/formal/sdk/@VERSION@/dpml-sdk-linux-@VERSION@.tar.gz";>
+ dpml-sdk-linux-@VERSION@.tar.gz</a>
+ </td>
+ <td>
+ <a
href="http://download.dpml.net/formal/sdk/@VERSION@/dpml-sdk-linux-@VERSION@.tar.gz.md5";>
+ MD5</a>
+ </td>
+ </tr>
+ <tr>
+ <td>Documentation Archive</td>
+ <td>
+ <a
href="http://download.dpml.net/formal/sdk/@VERSION@/dpml-sdk-docs-@VERSION@.zip";>
+ dpml-sdk-docs-@VERSION@.zip</a>
+ </td>
+ <td>
+ <a
href="http://download.dpml.net/formal/sdk/@VERSION@/dpml-sdk-docs-@VERSION@.zip.md5";>
+ MD5</a>
+ </td>
+ </tr>
+ </table>
+
+ </subsection>
+
<subsection name="Version 1.0.3">

<p>

Modified: trunk/central/site/src/docs/transit/cli/index.xml
===================================================================
--- trunk/central/site/src/docs/transit/cli/index.xml 2006-11-12 15:35:19
UTC (rev 1783)
+++ trunk/central/site/src/docs/transit/cli/index.xml 2006-11-18 17:46:43
UTC (rev 1784)
@@ -29,6 +29,8 @@

<section name="Transit Command Line">

+ <pre>@TRANSIT-CLI-URI@</pre>
+
<subsection name="Description">

<p>

Modified: trunk/main/depot/core/build.xml
===================================================================
--- trunk/main/depot/core/build.xml 2006-11-12 15:35:19 UTC (rev 1783)
+++ trunk/main/depot/core/build.xml 2006-11-18 17:46:43 UTC (rev 1784)
@@ -6,4 +6,15 @@

<transit:import uri="local:template:dpml/tools/standard"/>

+ <target name="package" depends="standard.package">
+ <echo>
+#----------------------------------------------------------------------------------
+# Updating Shared Lib. ${dpml.share}/lib
+#----------------------------------------------------------------------------------
+ </echo>
+ <mkdir dir="${dpml.share}/lib"/>
+ <copy preservelastmodified="true"
toFile="${dpml.share}/lib/${project.name}.jar"
+ file="${project.deliverable.jar.path}"/>
+ </target>
+
</project>

Modified: trunk/main/depot/core/src/main/net/dpml/depot/Main.java
===================================================================
--- trunk/main/depot/core/src/main/net/dpml/depot/Main.java 2006-11-12
15:35:19 UTC (rev 1783)
+++ trunk/main/depot/core/src/main/net/dpml/depot/Main.java 2006-11-18
17:46:43 UTC (rev 1784)
@@ -24,6 +24,7 @@
import java.rmi.RMISecurityManager;
import java.util.ArrayList;
import java.util.Date;
+import java.util.logging.LogManager;

import net.dpml.transit.Disposable;
import net.dpml.transit.Transit;
@@ -85,12 +86,12 @@

private Main( String[] arguments )
{
- String[] args = processSystemProperties( arguments );
-
//
// check for debug and trace cli options
//

+ String[] args = arguments;
+
if( CLIHelper.isOptionPresent( args, "-trace" ) )
{
args = CLIHelper.consolidate( args, "-trace" );
@@ -105,6 +106,8 @@
m_debug = true;
}

+ args = processSystemProperties( args );
+
//
// handle cli sub-system establishment
//
@@ -397,6 +400,14 @@
{
if( null == m_LOGGER )
{
+ try
+ {
+ LogManager.getLogManager().readConfiguration();
+ }
+ catch( Throwable e )
+ {
+ e.printStackTrace();
+ }
String category = System.getProperty( "dpml.logging.category",
"depot" );
m_LOGGER = new LoggingAdapter(
java.util.logging.Logger.getLogger( category ) );
}
@@ -417,6 +428,17 @@
return buffer.toString();
}

+ /**
+ * For all of the supplied command line arguments, if the
+ * argument is in the form -Dabc=def then extract the argument from
+ * the array and apply it as a system property. All non-system property
+ * arguments are included in the returned argument array.
+ *
+ * @param args the supplied commandline arguments including
+ * system property assignments
+ * @return the array of pure command line arguments (excluding
+ * and arg values recognized as system property declarations
+ */
private String[] processSystemProperties( String[] args )
{
ArrayList result = new ArrayList();

Modified: trunk/main/depot/module.xml
===================================================================
--- trunk/main/depot/module.xml 2006-11-12 15:35:19 UTC (rev 1783)
+++ trunk/main/depot/module.xml 2006-11-18 17:46:43 UTC (rev 1784)
@@ -5,7 +5,7 @@
xmlns:part="link:xsd:dpml/lang/dpml-part#1.0">

<properties>
- <property name="project.micro.version" value="3"/>
+ <property name="project.micro.version" value="4"/>
</properties>

<project name="dpml-library" basedir="library">
@@ -14,7 +14,7 @@
</info>
<properties>
<property name="project.minor.version" value="1"/>
- <property name="project.micro.version" value="1"/>
+ <property name="project.micro.version" value="2"/>
</properties>
<types>
<type id="jar"/>
@@ -42,7 +42,7 @@
</info>
<properties>
<property name="project.minor.version" value="1"/>
- <property name="project.micro.version" value="2"/>
+ <property name="project.micro.version" value="3"/>
</properties>
<types>
<type id="jar"/>
@@ -109,7 +109,7 @@
</info>
<properties>
<property name="project.minor.version" value="1"/>
- <property name="project.micro.version" value="2"/>
+ <property name="project.micro.version" value="3"/>
</properties>
<types>
<type id="jar"/>
@@ -150,7 +150,7 @@
</info>
<properties>
<property name="project.minor.version" value="1"/>
- <property name="project.micro.version" value="2"/>
+ <property name="project.micro.version" value="3"/>
</properties>
<types>
<type id="jar"/>
@@ -177,7 +177,7 @@
<description>Checkstyle plugin for Depot.</description>
</info>
<properties>
- <property name="project.micro.version" value="2"/>
+ <property name="project.micro.version" value="3"/>
</properties>
<types>
<type id="jar"/>

Added: trunk/main/depot/tools/src/main/net/dpml/tools/BuildError.java
===================================================================
--- trunk/main/depot/tools/src/main/net/dpml/tools/BuildError.java
2006-11-12 15:35:19 UTC (rev 1783)
+++ trunk/main/depot/tools/src/main/net/dpml/tools/BuildError.java
2006-11-18 17:46:43 UTC (rev 1784)
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2006 Stephen J. McConnell
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.tools;
+
+import org.apache.tools.ant.Location;
+
+/**
+ * A BuildError is thrown when a fatal error occurs during build execution.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class BuildError extends Error
+{
+ private final Location m_location;
+
+ /**
+ * Creation of a new BuildError.
+ * @param message the exception message
+ */
+ public BuildError( String message )
+ {
+ this( message, null );
+ }
+
+ /**
+ * Creation of a new BuildError.
+ * @param message the exception message
+ * @param cause the causal exception
+ */
+ public BuildError( String message, Throwable cause )
+ {
+ this( message, cause, null );
+ }
+
+ /**
+ * Creation of a new BuildError.
+ * @param message the exception message
+ * @param cause the causal exception
+ * @param location the location of the error
+ */
+ public BuildError( String message, Throwable cause, Location location )
+ {
+ super( message, cause );
+
+ m_location = location;
+ }
+
+ /**
+ * Return the location of the build error.
+ * @return the build location
+ */
+ public Location getLocation()
+ {
+ return m_location;
+ }
+}

Modified:
trunk/main/depot/tools/src/main/net/dpml/tools/impl/StandardBuilder.java
===================================================================
--- trunk/main/depot/tools/src/main/net/dpml/tools/impl/StandardBuilder.java
2006-11-12 15:35:19 UTC (rev 1783)
+++ trunk/main/depot/tools/src/main/net/dpml/tools/impl/StandardBuilder.java
2006-11-18 17:46:43 UTC (rev 1784)
@@ -28,6 +28,7 @@
import net.dpml.library.Resource;

import net.dpml.tools.Context;
+import net.dpml.tools.BuildError;
import net.dpml.tools.info.BuilderDirective;
import net.dpml.tools.info.BuilderDirectiveHelper;

@@ -138,8 +139,42 @@
*/
public boolean build( Resource resource, String[] targets )
{
- Project project = createProject( resource );
- File template = getTemplateFile( resource );
+ Project project = null;
+ File template = null;
+ try
+ {
+ project = createProject( resource );
+ }
+ catch( Throwable e )
+ {
+ m_result = e;
+ if( m_logger.isErrorEnabled() )
+ {
+ final String error =
+ "Failed to construct embedded project."
+ + "\nResource: " + resource.getResourcePath()
+ + "\nBasedir: " + resource.getBaseDir();
+ m_logger.error( error, e );
+ }
+ return false;
+ }
+ try
+ {
+ template = getTemplateFile( resource );
+ }
+ catch( Throwable e )
+ {
+ m_result = e;
+ if( m_logger.isErrorEnabled() )
+ {
+ final String error =
+ "Failed to load template file."
+ + "\nResource: " + resource.getResourcePath()
+ + "\nBasedir: " + resource.getBaseDir();
+ m_logger.error( error, e );
+ }
+ return false;
+ }
return build( resource, project, template, targets );
}

@@ -224,7 +259,7 @@
"Unexpected error while attempting to resolve project
template."
+ "\nResource path: "
+ resource.getResourcePath();
- throw new BuildException( error, e );
+ throw new BuildError( error, e );
}
}

@@ -291,6 +326,27 @@
}
return false;
}
+ catch( Throwable e )
+ {
+ System.out.println(
+ "# UNEXPECTED: "
+ + e.toString()
+ + " ("
+ + m_logger.isErrorEnabled()
+ + ")" );
+
+ m_result = e;
+ if( m_logger.isErrorEnabled() )
+ {
+ final String error =
+ "Build error."
+ + "\nProject: " + resource.getResourcePath()
+ + "\nBasedir: " + resource.getBaseDir()
+ + "\nTemplate: " + template;
+ m_logger.error( error, e );
+ }
+ return false;
+ }
finally
{
project.fireBuildFinished( m_result );
@@ -327,7 +383,7 @@
final String error =
"Unable to establish build context."
+ "\nProject: " + resource;
- throw new BuildException( error, e );
+ throw new BuildError( error, e );
}
}


Modified: trunk/main/depot/tools/src/main/net/dpml/tools/tasks/JavacTask.java
===================================================================
--- trunk/main/depot/tools/src/main/net/dpml/tools/tasks/JavacTask.java
2006-11-12 15:35:19 UTC (rev 1783)
+++ trunk/main/depot/tools/src/main/net/dpml/tools/tasks/JavacTask.java
2006-11-18 17:46:43 UTC (rev 1784)
@@ -51,6 +51,11 @@
/**
* Constant debug key.
*/
+ public static final String VERBOSE_KEY = "project.javac.verbose";
+
+ /**
+ * Constant debug key.
+ */
public static final String DEBUG_KEY = "project.javac.debug";

/**
@@ -181,6 +186,12 @@
javac.createCompilerArg().setValue( "-Xlint:" + lint );
}

+ String verbose = getProperty( "project.javac.verbose", "false" );
+ if( "true".equals( verbose ) )
+ {
+ javac.setVerbose( true );
+ }
+
final Path srcDirPath = new Path( project );
srcDirPath.createPathElement().setLocation( m_source );
javac.setSrcdir( srcDirPath );

Modified:
trunk/main/depot/tools/src/main/net/dpml/tools/tasks/PackageTask.java
===================================================================
--- trunk/main/depot/tools/src/main/net/dpml/tools/tasks/PackageTask.java
2006-11-12 15:35:19 UTC (rev 1783)
+++ trunk/main/depot/tools/src/main/net/dpml/tools/tasks/PackageTask.java
2006-11-18 17:46:43 UTC (rev 1784)
@@ -23,6 +23,7 @@
import net.dpml.library.Resource;

import net.dpml.tools.Context;
+import net.dpml.tools.BuildError;

import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
@@ -81,9 +82,12 @@
}
catch( Throwable e )
{
+ e.printStackTrace();
final String error =
- "Unexpected failure during part externalization.";
- throw new BuildException( error, e );
+ "Unexpected failure during part externalization in ["
+ + resource.getName()
+ + "]";
+ throw new BuildError( error, e, getLocation() );
}
}


Modified: trunk/main/depot/tools/src/main/net/dpml/tools/tasks/PartTask.java
===================================================================
--- trunk/main/depot/tools/src/main/net/dpml/tools/tasks/PartTask.java
2006-11-12 15:35:19 UTC (rev 1783)
+++ trunk/main/depot/tools/src/main/net/dpml/tools/tasks/PartTask.java
2006-11-18 17:46:43 UTC (rev 1784)
@@ -38,6 +38,7 @@
import net.dpml.transit.Artifact;

import net.dpml.tools.Context;
+import net.dpml.tools.BuildError;

import net.dpml.util.DefaultLogger;

@@ -128,9 +129,11 @@
return;
}
}
- catch( Exception e )
+ catch( Throwable e )
{
- // continue
+ final String error =
+ "Part comparisom failure.";
+ throw new BuildError( error, e );
}
}

@@ -161,7 +164,7 @@
{
final String error =
"Part externalization error.";
- throw new BuildException( error, e );
+ throw new BuildError( error, e );
}
}

@@ -205,7 +208,7 @@
final String error =
"Internal error while attempting to build an external part
definition."
+ "\nResource: " + resource;
- throw new BuildException( error, e, getLocation() );
+ throw new BuildError( error, e, getLocation() );
}
}


Modified: trunk/main/metro/module.xml
===================================================================
--- trunk/main/metro/module.xml 2006-11-12 15:35:19 UTC (rev 1783)
+++ trunk/main/metro/module.xml 2006-11-18 17:46:43 UTC (rev 1784)
@@ -5,7 +5,7 @@
xmlns:part="link:xsd:dpml/lang/dpml-part#1.0">

<properties>
- <property name="project.micro.version" value="3"/>
+ <property name="project.micro.version" value="4"/>
</properties>

<project name="dpml-metro-state" basedir="state">
@@ -138,7 +138,7 @@
</info>
<properties>
<property name="project.minor.version" value="1"/>
- <property name="project.micro.version" value="2"/>
+ <property name="project.micro.version" value="3"/>
</properties>
<types>
<type id="jar"/>
@@ -168,7 +168,7 @@
<properties>
<property name="project.javadoc.exclude" value="true"/>
<property name="project.minor.version" value="1"/>
- <property name="project.micro.version" value="2"/>
+ <property name="project.micro.version" value="3"/>
</properties>
<types>
<type id="jar"/>

Modified:
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/CompositionController.java
===================================================================
---
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/CompositionController.java
2006-11-12 15:35:19 UTC (rev 1783)
+++
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/CompositionController.java
2006-11-18 17:46:43 UTC (rev 1784)
@@ -111,7 +111,7 @@
m_listener = new InternalControllerContextListener();
m_context.addControllerContextListener( m_listener );
m_controller = new ComponentController( m_logger, this );
- m_events = new EventQueue( m_logger );
+ m_events = new EventQueue( m_logger, "DPML Metro Event Queue" );
}

EventQueue getEventQueue()

Modified:
trunk/main/metro/runtime/src/test/net/dpml/metro/runtime/DefaultStateMachineTestCase.java
===================================================================
---
trunk/main/metro/runtime/src/test/net/dpml/metro/runtime/DefaultStateMachineTestCase.java
2006-11-12 15:35:19 UTC (rev 1783)
+++
trunk/main/metro/runtime/src/test/net/dpml/metro/runtime/DefaultStateMachineTestCase.java
2006-11-18 17:46:43 UTC (rev 1784)
@@ -60,7 +60,7 @@
StateDecoder builder = new StateDecoder();
m_state = builder.loadState( example.toURI() );
m_logger = new DefaultLogger( "test" );
- m_queue = new EventQueue( m_logger );
+ m_queue = new EventQueue( m_logger, "StateMachine Event Queue" );
m_machine = new DefaultStateMachine( m_queue, m_logger, m_state
);
}
catch( Throwable e )

Modified: trunk/main/planet/module.xml
===================================================================
--- trunk/main/planet/module.xml 2006-11-12 15:35:19 UTC (rev 1783)
+++ trunk/main/planet/module.xml 2006-11-18 17:46:43 UTC (rev 1784)
@@ -5,7 +5,7 @@
<properties>
<property name="project.major.version" value="0"/>
<property name="project.minor.version" value="0"/>
- <property name="project.micro.version" value="3"/>
+ <property name="project.micro.version" value="4"/>
</properties>

<module file="http/module.xml"/>

Modified: trunk/main/station/console/etc/bin/station.lap
===================================================================
--- trunk/main/station/console/etc/bin/station.lap 2006-11-12 15:35:19
UTC (rev 1783)
+++ trunk/main/station/console/etc/bin/station.lap 2006-11-18 17:46:43
UTC (rev 1784)
@@ -9,6 +9,7 @@
-Djava.protocol.handler.pkgs=net.dpml.transit
-Djava.rmi.server.RMIClassLoaderSpi=net.dpml.depot.DepotRMIClassLoaderSpi
-Dcom.sun.management.jmxremote
+-Ddpml.transit.jmx.enabled=true
janel.main.class=net.dpml.depot.Main
janel.min.java.version=1.4.0
janel.classpath.jars.dir=${env.DPML_HOME}\share\lib

Modified: trunk/main/station/module.xml
===================================================================
--- trunk/main/station/module.xml 2006-11-12 15:35:19 UTC (rev 1783)
+++ trunk/main/station/module.xml 2006-11-18 17:46:43 UTC (rev 1784)
@@ -130,6 +130,7 @@
<include ref="dpml/transit/dpml-transit-main" tag="public"/>
<include ref="dpml/station/dpml-station-api" tag="public"/>
<include ref="dpml/station/dpml-station-builder" tag="protected"/>
+ <include ref="dpml/transit/dpml-transit-jmx" tag="protected"/>
<include ref="dpml/util/dpml-util-cli"/>
</runtime>
<test>

Modified:
trunk/main/station/server/src/main/net/dpml/station/server/StationServerPlugin.java
===================================================================
---
trunk/main/station/server/src/main/net/dpml/station/server/StationServerPlugin.java
2006-11-12 15:35:19 UTC (rev 1783)
+++
trunk/main/station/server/src/main/net/dpml/station/server/StationServerPlugin.java
2006-11-18 17:46:43 UTC (rev 1784)
@@ -38,6 +38,7 @@

import net.dpml.transit.Artifact;
import net.dpml.transit.model.TransitModel;
+import net.dpml.transit.management.TransitController;

import net.dpml.util.Logger;

@@ -99,6 +100,32 @@
{
try
{
+ // register MBeans
+
+ String jmxEnabled = System.getProperty(
"dpml.transit.jmx.enabled" );
+ if( "true".equals( jmxEnabled ) )
+ {
+ try
+ {
+ new TransitController( m_logger, m_model );
+ m_logger.info( "Transit controller established." );
+ }
+ catch( NoClassDefFoundError ncdfe )
+ {
+ if( m_logger.isWarnEnabled() )
+ {
+ m_logger.warn( "JMX resources unavailable." );
+ }
+ }
+ catch( ClassNotFoundException cnfe )
+ {
+ if( m_logger.isWarnEnabled() )
+ {
+ m_logger.warn( "JMX resources unavailable." );
+ }
+ }
+ }
+
int port = getPortValue( m_line, Registry.REGISTRY_PORT );
URI uri = (URI) m_line.getValue( URI_OPTION, null );
if( null == uri )

Modified: trunk/main/transit/core/build.xml
===================================================================
--- trunk/main/transit/core/build.xml 2006-11-12 15:35:19 UTC (rev 1783)
+++ trunk/main/transit/core/build.xml 2006-11-18 17:46:43 UTC (rev 1784)
@@ -27,7 +27,7 @@
</rmic>
</target>

- <target name="package" depends="standard.package">
+ <target name="update">
<echo>

#----------------------------------------------------------------------------------
# Updating Transit Prefs. ${dpml.prefs}/dpml/transit
@@ -37,6 +37,14 @@
<copy preservelastmodified="true" toDir="${dpml.prefs}/dpml/transit">
<fileset dir="${basedir}/target/prefs"/>
</copy>
+ <echo>
+#----------------------------------------------------------------------------------
+# Updating Shared Lib. ${dpml.share}/lib
+#----------------------------------------------------------------------------------
+ </echo>
+ <mkdir dir="${dpml.share}/lib"/>
+ <copy preservelastmodified="true"
toFile="${dpml.share}/lib/${project.name}.jar"
+ file="${project.deliverable.jar.path}" overwrite="true"/>
</target>

</project>

Modified: trunk/main/transit/core/src/main/net/dpml/lang/PartDecoder.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/lang/PartDecoder.java
2006-11-12 15:35:19 UTC (rev 1783)
+++ trunk/main/transit/core/src/main/net/dpml/lang/PartDecoder.java
2006-11-18 17:46:43 UTC (rev 1784)
@@ -385,7 +385,6 @@
* the builder, and returning the plugin instance as a builder instance.
*
* @param uri the part builder uri
- * @see Builder
* @exception DecodingException if a part decoding error occurs
* @exception Exception if part loading error occurs
*/
@@ -423,7 +422,7 @@
Logger logger = getLogger();
Object[] args = new Object[]{logger};
Object object = part.instantiate( args );
- if( object instanceof Builder )
+ if( Builder.class.isAssignableFrom( object.getClass() ) )
{
Builder builder = (Builder) object;
WeakReference reference = new WeakReference( builder );
@@ -432,12 +431,18 @@
}
else
{
+ String stack =
+ StandardClassLoader.toString(
+ getClass().getClassLoader(),
+ object.getClass().getClassLoader() );
+ String classname = object.getClass().getName();
final String error =
- "Plugin does not implement the "
+ "Plugin instance is not assignable to the "
+ Builder.class.getName()
+ " interface."
- + "\nURI: " + uri
- + "\nClass: " + object.getClass().getName();
+ + "\n URI: " + uri
+ + "\n Class: " + classname
+ + "\n" + stack;
throw new PartException( error );
}
}

Modified:
trunk/main/transit/core/src/main/net/dpml/lang/StandardClassLoader.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/lang/StandardClassLoader.java
2006-11-12 15:35:19 UTC (rev 1783)
+++ trunk/main/transit/core/src/main/net/dpml/lang/StandardClassLoader.java
2006-11-18 17:46:43 UTC (rev 1784)
@@ -355,15 +355,21 @@
buffer.append(
"\n----------------------------------------------------------------" );
list( buffer, anchor );
}
+ if( null != primary )
+ {
+ buffer.append(
"\n----------------------------------------------------------------" );
+ buffer.append( "\nPrimary Classloader" );
+ buffer.append(
"\n----------------------------------------------------------------" );
+ list( buffer, primary, anchor );
+ }
+ if( null != secondary )
+ {
+ buffer.append(
"\n----------------------------------------------------------------" );
+ buffer.append( "\nSecondary Classloader" );
+ buffer.append(
"\n----------------------------------------------------------------" );
+ list( buffer, secondary, anchor );
+ }
buffer.append(
"\n----------------------------------------------------------------" );
- buffer.append( "\nPrimary Classloader" );
- buffer.append(
"\n----------------------------------------------------------------" );
- list( buffer, primary, anchor );
- buffer.append(
"\n----------------------------------------------------------------" );
- buffer.append( "\nSecondary Classloader" );
- buffer.append(
"\n----------------------------------------------------------------" );
- list( buffer, secondary, anchor );
- buffer.append(
"\n----------------------------------------------------------------" );
return buffer.toString();
}


Modified: trunk/main/transit/core/src/main/net/dpml/transit/DTDResolver.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/DTDResolver.java
2006-11-12 15:35:19 UTC (rev 1783)
+++ trunk/main/transit/core/src/main/net/dpml/transit/DTDResolver.java
2006-11-18 17:46:43 UTC (rev 1784)
@@ -20,7 +20,10 @@

import java.io.IOException;
import java.io.InputStream;
+import java.net.URL;

+import net.dpml.lang.StandardClassLoader;
+
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
@@ -42,7 +45,7 @@
/**
* The ClassLoader to use when loading resources for DTDs.
*/
- private final ClassLoader m_classLoader;
+ private final ClassLoader m_classloader;

/**
* Construct a resolver using specified DTDInfos where resources are
loaded
@@ -51,7 +54,35 @@
public DTDResolver( final DTD[] dtds, final ClassLoader classLoader )
{
m_dtds = dtds;
- m_classLoader = classLoader;
+ m_classloader = classLoader;
+
+ /*
+ final ClassLoader loader = getClassLoader();
+ for( int i=0; i<dtds.length; i++ )
+ {
+ DTD dtd = dtds[i];
+ final String path = dtd.getResource();
+ URL url = loader.getResource( path );
+ if( null == url )
+ {
+ if( null == ClassLoader.getSystemClassLoader().getResource(
path ) )
+ {
+ String stack = StandardClassLoader.toString( loader,
null );
+ String sysLoaderProp = System.getProperty(
"java.system.class.loader" );
+ ClassLoader sysLoader =
ClassLoader.getSystemClassLoader();
+ final String error =
+ "Unresolvable DTD resource ["
+ + path
+ + "]"
+ + "\nPROP: " + sysLoaderProp
+ + "\nSYSTEM: " + sysLoader
+ + "\nCCL-STACK: " + stack
+ + "\nSYS-STACK: " + StandardClassLoader.toString(
sysLoader, null );
+ throw new TransitError( error );
+ }
+ }
+ }
+ */
}

/**
@@ -61,6 +92,9 @@
public InputSource resolveEntity( final String publicId, final String
systemId )
throws IOException, SAXException
{
+ //System.out.println( "# PUBLIC: " + publicId );
+ //System.out.println( "# SYSTEM: " + systemId );
+
for( int i=0; i<m_dtds.length; i++ )
{
final DTD info = m_dtds[i];
@@ -68,19 +102,52 @@
if( ( publicId != null && publicId.equals( info.getPublicId() )
)
|| ( systemId != null && systemId.equals( info.getSystemId()
) ) )
{
- final ClassLoader classLoader = getClassLoader();
- final InputStream inputStream =
- classLoader.getResourceAsStream( info.getResource() );
+ final String path = info.getResource();
+ final InputStream inputStream = resolveInputStream( path );
if( null == inputStream )
{
- String path = "resource:" + info.getResource();
- throw new NullPointerException( path );
+ final String error =
+ "Matched DTD identifier returned an unresolvable
resource path."
+ + "\nPublic ID: " + info.getPublicId()
+ + "\nSystem ID: " + info.getSystemId()
+ + "\nResource: '" + path + "'";
+ throw new TransitError( error );
}
- return new InputSource( inputStream );
+ else
+ {
+ return new InputSource( inputStream );
+ }
}
}
return null;
}
+
+ private InputStream resolveInputStream( String path )
+ {
+ InputStream input =
ClassLoader.getSystemClassLoader().getResourceAsStream( path );
+ if( null != input )
+ {
+ return input;
+ }
+ ClassLoader context = Thread.currentThread().getContextClassLoader();
+ if( null != context )
+ {
+ input = context.getResourceAsStream( path );
+ if( null != input )
+ {
+ return input;
+ }
+ }
+ if( null != m_classloader )
+ {
+ input = m_classloader.getResourceAsStream( path );
+ if( null != input )
+ {
+ return input;
+ }
+ }
+ return null;
+ }

/**
* Return CLassLoader to load resource from.
@@ -90,7 +157,7 @@
*/
private ClassLoader getClassLoader()
{
- ClassLoader classLoader = m_classLoader;
+ ClassLoader classLoader = m_classloader;
if( null == classLoader )
{
classLoader = Thread.currentThread().getContextClassLoader();

Modified:
trunk/main/transit/core/src/main/net/dpml/transit/DefaultTransitModel.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/DefaultTransitModel.java
2006-11-12 15:35:19 UTC (rev 1783)
+++
trunk/main/transit/core/src/main/net/dpml/transit/DefaultTransitModel.java
2006-11-18 17:46:43 UTC (rev 1784)
@@ -68,8 +68,6 @@
*/
public static final String PROFILE_KEY = "dpml.transit.profile";

- private static final EventQueue EVENT_QUEUE = new EventQueue(
"dpml.transit" );
-
/**
* Return a model that is restricted to the secure local environment with
* no proxy setting or external hosts.
@@ -87,7 +85,8 @@
int id = System.identityHashCode( system );
logger.trace( "system classloader id: " + id );
}
- return new DefaultTransitModel( EVENT_QUEUE, logger, directive );
+ EventQueue queue = new EventQueue( logger, "DPML Transit Event
Queue" );
+ return new DefaultTransitModel( queue, logger, directive );
}
catch( Exception e )
{
@@ -149,7 +148,7 @@
URL url = uri.toURL();
TransitBuilder builder = new TransitBuilder( logger );
TransitDirective directive = builder.load( url );
- return new DefaultTransitModel( EVENT_QUEUE, logger, directive );
+ return new DefaultTransitModel( logger, directive );
}
else
{
@@ -161,7 +160,7 @@
URL url = uri.toURL();
TransitBuilder builder = new TransitBuilder( logger );
TransitDirective directive = builder.load( url );
- return new DefaultTransitModel( EVENT_QUEUE, logger,
directive );
+ return new DefaultTransitModel( logger, directive );
}
else
{
@@ -195,7 +194,9 @@
public DefaultTransitModel( Logger logger, TransitDirective directive )
throws RemoteException, NullPointerException
{
- this( EVENT_QUEUE, logger, directive );
+ this(
+ new EventQueue( logger, "DPML Transit Event Queue" ),
+ logger, directive );
}

/**
@@ -219,9 +220,9 @@
{
throw new NullPointerException( "directive" );
}
-
- m_proxy = createProxyModel( directive );
- m_cache = createCacheModel( directive );
+
+ m_proxy = createProxyModel( queue, directive );
+ m_cache = createCacheModel( queue, directive );
}

//
------------------------------------------------------------------------
@@ -319,7 +320,7 @@
disposeCacheModel();
disposeProxyModel();
super.dispose();
- EVENT_QUEUE.terminateDispatchThread();
+ getEventQueue().terminateDispatchThread();
Thread thread = new Terminator( this );
thread.start();
}
@@ -396,7 +397,7 @@
}
}

- private DefaultProxyModel createProxyModel( final TransitDirective
directive )
+ private DefaultProxyModel createProxyModel( final EventQueue queue,
final TransitDirective directive )
{
try
{
@@ -408,7 +409,7 @@
else
{
Logger logger = getLogger().getChildLogger( "proxy" );
- return new DefaultProxyModel( EVENT_QUEUE, logger, config );
+ return new DefaultProxyModel( queue, logger, config );
}
}
catch( Throwable e )
@@ -419,13 +420,13 @@
}
}

- private DefaultCacheModel createCacheModel( final TransitDirective
directive )
+ private DefaultCacheModel createCacheModel( final EventQueue queue,
final TransitDirective directive )
{
try
{
Logger logger = getLogger().getChildLogger( "cache" );
CacheDirective config = directive.getCacheDirective();
- return new DefaultCacheModel( EVENT_QUEUE, logger, config );
+ return new DefaultCacheModel( queue, logger, config );
}
catch( Throwable e )
{
@@ -444,7 +445,8 @@
static DefaultTransitModel getClassicModel( Logger logger ) throws
Exception
{
TransitDirective directive = TransitDirective.CLASSIC_PROFILE;
- return new DefaultTransitModel( EVENT_QUEUE, logger, directive );
+ EventQueue queue = new EventQueue( logger, "DPML Transit Event
Queue" );
+ return new DefaultTransitModel( queue, logger, directive );
}

private static URI createStaticURI( String path )

Modified: trunk/main/transit/core/src/main/net/dpml/transit/Transit.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/Transit.java
2006-11-12 15:35:19 UTC (rev 1783)
+++ trunk/main/transit/core/src/main/net/dpml/transit/Transit.java
2006-11-18 17:46:43 UTC (rev 1784)
@@ -55,12 +55,12 @@
public static final String HOME_KEY = "dpml.home";

/**
- * DPML home key.
+ * DPML data key.
*/
public static final String DATA_KEY = "dpml.data";

/**
- * DPML home key.
+ * DPML prefs key.
*/
public static final String PREFS_KEY = "dpml.prefs";


Modified:
trunk/main/transit/core/src/main/net/dpml/transit/TransitBuilder.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/TransitBuilder.java
2006-11-12 15:35:19 UTC (rev 1783)
+++ trunk/main/transit/core/src/main/net/dpml/transit/TransitBuilder.java
2006-11-18 17:46:43 UTC (rev 1784)
@@ -85,8 +85,8 @@
RESOURCE, null )
};

- private static final DTDResolver DTD_RESOLVER =
- new DTDResolver( DTDS, TransitBuilder.class.getClassLoader() );
+ //private static final DTDResolver DTD_RESOLVER =
+ // new DTDResolver( DTDS, TransitBuilder.class.getClassLoader() );

private Logger m_logger;

@@ -116,7 +116,9 @@
factory.setNamespaceAware( true );
factory.setExpandEntityReferences( true );
DocumentBuilder builder = factory.newDocumentBuilder();
- builder.setEntityResolver( DTD_RESOLVER );
+ DTDResolver resolver =
+ new DTDResolver( DTDS, getClass().getClassLoader() );
+ builder.setEntityResolver( resolver );
ErrorHandler errors = new SaxMonitor( m_logger );
builder.setErrorHandler( errors );


Modified: trunk/main/transit/core/src/main/net/dpml/util/EventQueue.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/util/EventQueue.java
2006-11-12 15:35:19 UTC (rev 1783)
+++ trunk/main/transit/core/src/main/net/dpml/util/EventQueue.java
2006-11-18 17:46:43 UTC (rev 1784)
@@ -49,28 +49,58 @@

/**
* Creation of a new event queue.
- * @param name the name used to construct a logging channel
+ * @param category the name used to construct a logging channel
+ * @deprecated Use new EventQueue( logger, "Thread name" ) instead.
*/
- public EventQueue( String name )
+ public EventQueue( String category )
{
- this( getLoggerForCategory( name ) );
+ this( category, "Event Dispatch Thread" );
}

/**
* Creation of a new model.
* @param logger the assigned logging channel
* @exception NullPointerException if the supplied logging channel is null
+ * @deprecated Use new EventQueue( logger, "Thread name" ) instead.
*/
public EventQueue( Logger logger )
throws NullPointerException
{
+ this( logger, "Event Dispatch Thread" );
+ }
+
+ /**
+ * Creation of a new event queue.
+ * @param category the name used to construct a logging channel
+ * @param name the name to assign to the thread
+ */
+ public EventQueue( String category, String name )
+ {
+ this( getLoggerForCategory( category ), name );
+ }
+
+ /**
+ * Creation of a new model.
+ * @param logger the assigned logging channel
+ * @param name the name to assign to the thread
+ * @exception NullPointerException if the supplied logging channel or
+ * thread name is null
+ */
+ public EventQueue( Logger logger, String name )
+ throws NullPointerException
+ {
if( null == logger )
{
throw new NullPointerException( "logger" );
}
+ if( null == name )
+ {
+ throw new NullPointerException( "name" );
+ }
m_logger = logger;
m_queue = new LinkedList();
m_thread = new EventDispatchThread();
+ m_thread.setName( name );
m_thread.setDaemon( true );
m_thread.start();
}


Property changes on: trunk/main/transit/jmx
___________________________________________________________________
Name: svn:ignore
+ target


Added:
trunk/main/transit/jmx/src/main/net/dpml/transit/management/HostController.java
===================================================================
---
trunk/main/transit/jmx/src/main/net/dpml/transit/management/HostController.java
2006-11-12 15:35:19 UTC (rev 1783)
+++
trunk/main/transit/jmx/src/main/net/dpml/transit/management/HostController.java
2006-11-18 17:46:43 UTC (rev 1784)
@@ -0,0 +1,114 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.transit.management;
+
+import javax.management.AttributeChangeNotification;
+import javax.management.MBeanNotificationInfo;
+import javax.management.NotificationBroadcasterSupport;
+import javax.management.MBeanException;
+
+import net.dpml.transit.model.HostModel;
+
+/**
+ * Transit MBean.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class HostController implements HostControllerMXBean
+{
+ private HostModel m_model;
+
+ public HostController( final HostModel model ) throws Exception
+ {
+ m_model = model;
+ }
+
+ public String getID() throws MBeanException
+ {
+ try
+ {
+ return m_model.getID();
+ }
+ catch( Exception e )
+ {
+ throw new MBeanException( e );
+ }
+ }
+
+ public int getPriority() throws MBeanException
+ {
+ try
+ {
+ return m_model.getPriority();
+ }
+ catch( Exception e )
+ {
+ throw new MBeanException( e );
+ }
+ }
+
+ public String getBase() throws MBeanException
+ {
+ try
+ {
+ return m_model.getBasePath();
+ }
+ catch( Exception e )
+ {
+ throw new MBeanException( e );
+ }
+ }
+
+ public String getLayout() throws MBeanException
+ {
+ try
+ {
+ return m_model.getLayoutModel().getID();
+ }
+ catch( Exception e )
+ {
+ throw new MBeanException( e );
+ }
+ }
+
+ public boolean getEnabled() throws MBeanException
+ {
+ try
+ {
+ return m_model.getEnabled();
+ }
+ catch( Exception e )
+ {
+ throw new MBeanException( e );
+ }
+ }
+
+ public boolean getTrusted() throws MBeanException
+ {
+ try
+ {
+ return m_model.getTrusted();
+ }
+ catch( Exception e )
+ {
+ throw new MBeanException( e );
+ }
+ }
+}
\ No newline at end of file

Added:
trunk/main/transit/jmx/src/main/net/dpml/transit/management/HostControllerMXBean.java
===================================================================
---
trunk/main/transit/jmx/src/main/net/dpml/transit/management/HostControllerMXBean.java
2006-11-12 15:35:19 UTC (rev 1783)
+++
trunk/main/transit/jmx/src/main/net/dpml/transit/management/HostControllerMXBean.java
2006-11-18 17:46:43 UTC (rev 1784)
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.transit.management;
+
+import javax.management.MBeanException;
+
+/**
+ * Transit MBean.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public interface HostControllerMXBean
+{
+ String getID() throws MBeanException;
+
+ int getPriority() throws MBeanException;
+
+ String getBase() throws MBeanException;
+
+ String getLayout() throws MBeanException;
+
+ boolean getEnabled() throws MBeanException;
+
+ boolean getTrusted() throws MBeanException;
+
+}
\ No newline at end of file

Added:
trunk/main/transit/jmx/src/main/net/dpml/transit/management/LayoutController.java
===================================================================
---
trunk/main/transit/jmx/src/main/net/dpml/transit/management/LayoutController.java
2006-11-12 15:35:19 UTC (rev 1783)
+++
trunk/main/transit/jmx/src/main/net/dpml/transit/management/LayoutController.java
2006-11-18 17:46:43 UTC (rev 1784)
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.transit.management;
+
+import javax.management.AttributeChangeNotification;
+import javax.management.MBeanNotificationInfo;
+import javax.management.NotificationBroadcasterSupport;
+import javax.management.MBeanException;
+
+import net.dpml.transit.model.LayoutModel;
+
+/**
+ * Transit MBean.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class LayoutController implements LayoutControllerMXBean
+{
+ private LayoutModel m_model;
+
+ public LayoutController( final LayoutModel model )
+ {
+ m_model = model;
+ }
+
+ public String getID() throws MBeanException
+ {
+ try
+ {
+ return m_model.getID();
+ }
+ catch( Exception e )
+ {
+ throw new MBeanException( e );
+ }
+ }
+
+ public String getTitle() throws MBeanException
+ {
+ try
+ {
+ return m_model.getTitle();
+ }
+ catch( Exception e )
+ {
+ throw new MBeanException( e );
+ }
+ }
+
+ public String getClassname() throws MBeanException
+ {
+ try
+ {
+ return m_model.getClassname();
+ }
+ catch( Exception e )
+ {
+ throw new MBeanException( e );
+ }
+ }
+}
\ No newline at end of file

Added:
trunk/main/transit/jmx/src/main/net/dpml/transit/management/LayoutControllerMXBean.java
===================================================================
---
trunk/main/transit/jmx/src/main/net/dpml/transit/management/LayoutControllerMXBean.java
2006-11-12 15:35:19 UTC (rev 1783)
+++
trunk/main/transit/jmx/src/main/net/dpml/transit/management/LayoutControllerMXBean.java
2006-11-18 17:46:43 UTC (rev 1784)
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.transit.management;
+
+import javax.management.MBeanException;
+
+/**
+ * Transit MBean.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public interface LayoutControllerMXBean
+{
+ String getID() throws MBeanException;
+
+ String getTitle() throws MBeanException;
+
+ String getClassname() throws MBeanException;
+
+}
\ No newline at end of file

Added:
trunk/main/transit/jmx/src/main/net/dpml/transit/management/TransitController.java
===================================================================
---
trunk/main/transit/jmx/src/main/net/dpml/transit/management/TransitController.java
2006-11-12 15:35:19 UTC (rev 1783)
+++
trunk/main/transit/jmx/src/main/net/dpml/transit/management/TransitController.java
2006-11-18 17:46:43 UTC (rev 1784)
@@ -0,0 +1,302 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.transit.management;
+
+import java.lang.management.ManagementFactory;
+import java.net.PasswordAuthentication;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Hashtable;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import javax.management.AttributeChangeNotification;
+import javax.management.MBeanNotificationInfo;
+import javax.management.NotificationBroadcasterSupport;
+import javax.management.MBeanException;
+
+import net.dpml.transit.Transit;
+import net.dpml.transit.DefaultTransitModel;
+import net.dpml.transit.model.TransitModel;
+import net.dpml.transit.model.HostModel;
+import net.dpml.transit.model.LayoutModel;
+import net.dpml.transit.model.ProxyModel;
+import net.dpml.transit.monitor.LoggingAdapter;
+
+import net.dpml.util.Logger;
+
+/**
+ * Transit MBean.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class TransitController extends NotificationBroadcasterSupport
implements TransitControllerMXBean
+{
+ /**
+ * The Transit system version.
+ */
+ public static final String VERSION = "@PROJECT-VERSION@";
+
+ private TransitModel m_model;
+ private Logger m_logger;
+ private List m_layouts = new ArrayList();
+ private List m_hosts = new ArrayList();
+
+ public TransitController( final Logger logger, final TransitModel model
) throws Exception
+ {
+ this( ManagementFactory.getPlatformMBeanServer(), logger, model );
+ }
+
+ public TransitController( final MBeanServer server, final Logger logger,
final TransitModel model ) throws Exception
+ {
+ m_model = model;
+ m_logger = logger;
+
+ Hashtable table = new Hashtable();
+ table.put( "type", "Transit" );
+ ObjectName name =
+ ObjectName.getInstance( "net.dpml", table );
+ server.registerMBean( this, name );
+
+ HostModel[] hosts = m_model.getCacheModel().getHostModels();
+ for( int i=0; i < hosts.length; i++ )
+ {
+ HostModel host = hosts[i];
+ addHostModel( server, m_hosts, host );
+ }
+
+ LayoutModel[] layouts =
m_model.getCacheModel().getLayoutRegistryModel().getLayoutModels();
+ for( int i=0; i < layouts.length; i++ )
+ {
+ LayoutModel layout = layouts[i];
+ addLayoutModel( server, m_layouts, layout );
+ }
+ }
+
+ private void addLayoutModel( final MBeanServer server, final List list,
final LayoutModel layout ) throws MBeanException
+ {
+ try
+ {
+ String id = layout.getID();
+ Hashtable table = new Hashtable();
+ table.put( "type", "TransitLayouts" );
+ table.put( "name", id );
+ ObjectName name =
+ ObjectName.getInstance( "net.dpml", table );
+ LayoutController controller = new LayoutController( layout );
+ server.registerMBean( controller, name );
+ list.add( controller );
+ }
+ catch( Exception e )
+ {
+ throw new MBeanException( e );
+ }
+ }
+
+ private void addHostModel( final MBeanServer server, final List list,
final HostModel host ) throws MBeanException
+ {
+ try
+ {
+ String id = host.getID();
+ Hashtable table = new Hashtable();
+ table.put( "type", "TransitHosts" );
+ table.put( "name", id );
+ ObjectName name =
+ ObjectName.getInstance( "net.dpml", table );
+ HostController controller = new HostController( host );
+ list.add( controller );
+ server.registerMBean( controller, name );
+ }
+ catch( Exception e )
+ {
+ throw new MBeanException( e );
+ }
+ }
+
+ public String getProxyHost() throws MBeanException
+ {
+ try
+ {
+ return m_model.getProxyModel().getHost().toString();
+ }
+ catch( Exception e )
+ {
+ throw new MBeanException( e );
+ }
+ }
+
+ public String getProxyUsername() throws MBeanException
+ {
+ try
+ {
+ PasswordAuthentication auth =
m_model.getProxyModel().getAuthentication();
+ if( null != auth )
+ {
+ return auth.getUserName();
+ }
+ else
+ {
+ return null;
+ }
+ }
+ catch( Exception e )
+ {
+ throw new MBeanException( e );
+ }
+ }
+
+ public String getProxyPassword() throws MBeanException
+ {
+ try
+ {
+ PasswordAuthentication auth =
m_model.getProxyModel().getAuthentication();
+ if( null != auth )
+ {
+ return "*******";
+ }
+ else
+ {
+ return null;
+ }
+ }
+ catch( Exception e )
+ {
+ throw new MBeanException( e );
+ }
+ }
+ public String getCacheDirectoryPath() throws MBeanException
+ {
+ try
+ {
+ return m_model.getCacheModel().getCacheDirectoryPath();
+ }
+ catch( Exception e )
+ {
+ throw new MBeanException( e );
+ }
+ }
+
+ public String getCacheDirectory() throws MBeanException
+ {
+ try
+ {
+ return
m_model.getCacheModel().getCacheDirectory().getCanonicalPath();
+ }
+ catch( Exception e )
+ {
+ throw new MBeanException( e );
+ }
+ }
+
+ public String getCacheLayoutID() throws MBeanException
+ {
+ try
+ {
+ return m_model.getCacheModel().getLayoutModel().getID();
+ }
+ catch( Exception e )
+ {
+ throw new MBeanException( e );
+ }
+ }
+
+ public String getCacheLayoutTitle() throws MBeanException
+ {
+ try
+ {
+ return m_model.getCacheModel().getLayoutModel().getTitle();
+ }
+ catch( Exception e )
+ {
+ throw new MBeanException( e );
+ }
+ }
+
+ public String getHome() throws MBeanException
+ {
+ try
+ {
+ return Transit.DPML_HOME.getCanonicalPath();
+ }
+ catch( Exception e )
+ {
+ throw new MBeanException( e );
+ }
+ }
+
+ public String getData() throws MBeanException
+ {
+ try
+ {
+ return Transit.DPML_DATA.getCanonicalPath();
+ }
+ catch( Exception e )
+ {
+ throw new MBeanException( e );
+ }
+ }
+
+ public String getPrefs() throws MBeanException
+ {
+ try
+ {
+ return Transit.DPML_PREFS.getCanonicalPath();
+ }
+ catch( Exception e )
+ {
+ throw new MBeanException( e );
+ }
+ }
+
+ public String getShare() throws MBeanException
+ {
+ try
+ {
+ return Transit.DPML_SYSTEM.getCanonicalPath();
+ }
+ catch( Exception e )
+ {
+ throw new MBeanException( e );
+ }
+ }
+
+ public String getVersion() throws MBeanException
+ {
+ try
+ {
+ return Transit.VERSION;
+ }
+ catch( Exception e )
+ {
+ throw new MBeanException( e );
+ }
+ }
+
+ public LayoutControllerMXBean[] getLayouts()
+ {
+ return (LayoutControllerMXBean[]) m_layouts.toArray( new
LayoutControllerMXBean[0] );
+ }
+
+ public HostControllerMXBean[] getHosts()
+ {
+ return (HostControllerMXBean[]) m_hosts.toArray( new
HostControllerMXBean[0] );
+ }
+}

Added:
trunk/main/transit/jmx/src/main/net/dpml/transit/management/TransitControllerMXBean.java
===================================================================
---
trunk/main/transit/jmx/src/main/net/dpml/transit/management/TransitControllerMXBean.java
2006-11-12 15:35:19 UTC (rev 1783)
+++
trunk/main/transit/jmx/src/main/net/dpml/transit/management/TransitControllerMXBean.java
2006-11-18 17:46:43 UTC (rev 1784)
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.transit.management;
+
+import javax.management.MBeanException;
+
+/**
+ * Transit MBean.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public interface TransitControllerMXBean
+{
+ String getHome() throws MBeanException;
+
+ String getData() throws MBeanException;
+
+ String getPrefs() throws MBeanException;
+
+ String getShare() throws MBeanException;
+
+ String getVersion() throws MBeanException;
+
+ String getCacheDirectoryPath() throws MBeanException;
+
+ String getCacheDirectory() throws MBeanException;
+
+ String getCacheLayoutID() throws MBeanException;
+
+ String getCacheLayoutTitle() throws MBeanException;
+
+ String getProxyHost() throws MBeanException;
+
+ String getProxyUsername() throws MBeanException;
+
+ String getProxyPassword() throws MBeanException;
+
+ LayoutControllerMXBean[] getLayouts();
+
+ HostControllerMXBean[] getHosts();
+}
\ No newline at end of file

Modified: trunk/main/transit/module.xml
===================================================================
--- trunk/main/transit/module.xml 2006-11-12 15:35:19 UTC (rev 1783)
+++ trunk/main/transit/module.xml 2006-11-18 17:46:43 UTC (rev 1784)
@@ -8,7 +8,7 @@
<property name="project.test.fork" value="true"/>
<property name="project.major.version" value="1"/>
<property name="project.minor.version" value="0"/>
- <property name="project.micro.version" value="3"/>
+ <property name="project.micro.version" value="4"/>
</properties>

<project name="dpml-transit-console" basedir="console">
@@ -81,4 +81,23 @@
</dependencies>
</project>

+ <project name="dpml-transit-jmx" basedir="jmx">
+ <info title="DPML Transit JMX">
+ <description>Transit JMX Management Support.</description>
+ </info>
+ <properties>
+ <property name="project.major.version" value="0"/>
+ <property name="project.minor.version" value="0"/>
+ <property name="project.micro.version" value="0"/>
+ </properties>
+ <types>
+ <type id="jar"/>
+ </types>
+ <dependencies>
+ <runtime>
+ <include key="dpml-transit-main"/>
+ </runtime>
+ </dependencies>
+ </project>
+
</module>




  • r1784 - in trunk: central central/site/etc/docs central/site/etc/docs/images/transit central/site/src/docs/about/download central/site/src/docs/transit/cli main/depot main/depot/core main/depot/core/src/main/net/dpml/depot main/depot/tools/src/main/net/dpml/tools main/depot/tools/src/main/net/dpml/tools/impl main/depot/tools/src/main/net/dpml/tools/tasks main/metro main/metro/runtime/src/main/net/dpml/metro/runtime main/metro/runtime/src/test/net/dpml/metro/runtime main/planet main/station main/station/console/etc/bin main/station/server/src/main/net/dpml/station/server main/transit main/transit/core main/transit/core/src/main/net/dpml/lang main/transit/core/src/main/net/dpml/transit main/transit/core/src/main/net/dpml/util main/transit/jmx main/transit/jmx/src main/transit/jmx/src/main main/transit/jmx/src/main/net main/transit/jmx/src/main/net/dpml main/transit/jmx/src/main/net/dpml/transit main/transit/jmx/src/main/net/dpml/transit/management, mcconnell at BerliOS, 11/18/2006

Archive powered by MHonArc 2.6.24.

Top of Page