Skip to Content.
Sympa Menu

notify-dpml - r1052 - in trunk/main: central/src/docs/metro/runtime central/src/docs/metro/runtime/components central/src/docs/metro/tasks metro/runtime/src/main/net/dpml/metro/runtime metro/test

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: r1052 - in trunk/main: central/src/docs/metro/runtime central/src/docs/metro/runtime/components central/src/docs/metro/tasks metro/runtime/src/main/net/dpml/metro/runtime metro/test
  • Date: Tue, 7 Feb 2006 07:11:18 +0100

Author: mcconnell
Date: 2006-02-07 07:11:07 +0100 (Tue, 07 Feb 2006)
New Revision: 1052

Added:
trunk/main/central/src/docs/metro/runtime/components/models.xml
Removed:
trunk/main/central/src/docs/metro/runtime/models.xml
Modified:
trunk/main/central/src/docs/metro/runtime/components/index.xml
trunk/main/central/src/docs/metro/runtime/components/navigation.xml
trunk/main/central/src/docs/metro/runtime/index.xml
trunk/main/central/src/docs/metro/runtime/navigation.xml
trunk/main/central/src/docs/metro/tasks/navigation.xml

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

trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/DefaultProvider.java
trunk/main/metro/test/build.xml
Log:
housekeeping

Modified: trunk/main/central/src/docs/metro/runtime/components/index.xml
===================================================================
--- trunk/main/central/src/docs/metro/runtime/components/index.xml
2006-02-06 21:34:17 UTC (rev 1051)
+++ trunk/main/central/src/docs/metro/runtime/components/index.xml
2006-02-07 06:11:07 UTC (rev 1052)
@@ -46,10 +46,6 @@
runtime service providers bound to the type/directive combination.
</p>

- </subsection>
-
- <subsection name="Handler Configuration">
-
<p>
Creation of a new <tt>Component</tt> is managed exclusively by the
top-level
<a href="../controller/index.html">controller</a>. An new component
may be created
@@ -70,7 +66,68 @@
</p>

</subsection>
+
+ <subsection name="Principal Interfaces">

+ <p>Principal interfaces used in the component model include:</p>
+
+ <table>
+ <tr>
+ <td>Component</td>
+ <td>
+ A remotely accessible view of a component. The Component
interface
+ exposes information about the component activation policy,
access to
+ instance handlers (the Provider) and general operations
supporting
+ component assembly.
+ </td>
+ </tr>
+ <tr>
+ <td>Provider</td>
+ <td>
+ A remotely accessible view of a managed component instance.
The
+ <tt>Provider</tt> is in effect an component instance with
associated
+ deployment state, A given component instance may have 0..n
provider
+ instances associated with it (controller by the associated
component
+ lifestyle policy).
+ </td>
+ </tr>
+ </table>
+
+ <p>
+ Component implementation acting in the capacity of a container (a
component
+ with one or more internal parts) can aquire access to privilaged
management
+ interfaces enabling fine grain control of a composition. These
management
+ interface include:
+ </p>
+
+ <table>
+ <tr>
+ <td>PartsManager</td>
+ <td>
+ The PartsManager interface is a local interface accessible to
+ component implementations that are acting in the role of a
container
+ (i.e. a component managing a collection of subsidiary
components. Using
+ the parts manager a component implementation can directly
access
+ internal components as <tt>ComponentHandler</tt> instances.
The
+ <tt>PartsManager</tt> may be declared as a component
implementation
+ constructor argument.
+ </td>
+ </tr>
+ <tr>
+ <td>ComponentHandler</td>
+ <td>
+ The ComponentHandler interface provides a set of operations
that
+ enable local management of the component context,
configuration and
+ related policies. In addition the component handler exposes
operations
+ through which the managing implementation may navigate the
structure
+ of its internal parts. <tt>ComponentHandler</tt> instances
may be
+ resolved via the <tt>Partsmanager</tt>.
+ </td>
+ </tr>
+ </table>
+
+ </subsection>
+
</section>

</body>

Copied: trunk/main/central/src/docs/metro/runtime/components/models.xml (from
rev 1045, trunk/main/central/src/docs/metro/runtime/models.xml)

Modified: trunk/main/central/src/docs/metro/runtime/components/navigation.xml
===================================================================
--- trunk/main/central/src/docs/metro/runtime/components/navigation.xml
2006-02-06 21:34:17 UTC (rev 1051)
+++ trunk/main/central/src/docs/metro/runtime/components/navigation.xml
2006-02-07 06:11:07 UTC (rev 1052)
@@ -25,6 +25,7 @@
<body>

<menu>
+ <item name="Models" href="models.html"/>
<item name="Provider" href="provider.html"/>
<item name="State" href="state.html"/>
</menu>

Modified: trunk/main/central/src/docs/metro/runtime/index.xml
===================================================================
--- trunk/main/central/src/docs/metro/runtime/index.xml 2006-02-06 21:34:17
UTC (rev 1051)
+++ trunk/main/central/src/docs/metro/runtime/index.xml 2006-02-07 06:11:07
UTC (rev 1052)
@@ -43,20 +43,14 @@
use by deployment tools and the runtime system.
</li>
<li>
- <a href="parts/index.html">part:</a>
- a standalone component definition referencable via the
<tt>artifact</tt>
- uri using the <tt>part</tt> type identifier. The part
definition contains
- the default deployment profile for a component including the
definition of
+ <a href="parts/index.html">directive:</a>
+ a XML component definition referencable via the <tt>artifact</tt>
+ uri using the <tt>part</tt> type identifier. The part directive
contains
+ the default deployment profile including the definition of
the component inital context, dependency solutions, and any
related
- configuration information. The <tt>part</tt> serves as the
initial data
+ configuration information. The directives serves as the initial
data
used to establish a component model.
</li>
- <li>
- <a href="controller/models.html">model:</a>
- management of component and context state is supported though a
set of
- model interfaces that are using in conjuction with the reference
- implementation.
- </li>
</ul>

</subsection>
@@ -71,11 +65,11 @@
</p>

<p>
- Using a network accessible <tt>part</tt>, the Metro
+ Using a network accessible <tt>part</tt> datastructrues, the Metro
runtime provides support for the creation of a <tt>Component</tt>
via
a <tt>Controller</tt>. The <tt>Component</tt> handles scopped
requests
for locating service providers and establishment of managed
- <tt>Instance</tt>(s).
+ <tt>Provider</tt>(s).
</p>

<ul>

Deleted: trunk/main/central/src/docs/metro/runtime/models.xml
===================================================================
--- trunk/main/central/src/docs/metro/runtime/models.xml 2006-02-06
21:34:17 UTC (rev 1051)
+++ trunk/main/central/src/docs/metro/runtime/models.xml 2006-02-07
06:11:07 UTC (rev 1052)
@@ -1,113 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<document>
-
- <properties>
- <author email="mcconnell AT dpml.net">Stephen McConnell</author>
- <title>DPML Metro Deployment Solutions</title>
- </properties>
-
- <body>
-
- <section name="Models">
-
- <p>
- Within the Metro system there is a distinct separation between
- the model of a component, the component runtime machinery, and
- the component implementation. The component model is a remotely
- accessible object through which the runtime machinery can access
- configuration information about a component. The runtime machinery
- basically handles concerns such as assembly, deployment,
- decommissioning and so forth.
- </p>
-
- <p>
- A component model is created using the standard <a
href="controller/index.html">
- controller</a>.
- </p>
-
- <pre>
-Controller controller = Controller.STANDARD;
-URI uri = new URI( "artifact:part:acme/acme-widget#1.1" );
-<font color="darkred">Model model = controller.createModel( uri );</font>
-Component component = controller.createComponent( model );
- </pre>
-
- <p>
- Note that the model returned from the controller is remotable and as
- such the system handling model configuration may be executing in a
- different virtual machine to the component runtime. Equally, a
- component deployment system can register a model with a central
- management system (as is the case with the Station manager).
- </p>
-
- <p>
- The Metro system defines a number of extended model interfaces that
- allow control of aspects of the component and context model. These
- interfaces are described below - however, please note that these
- interfaces are specific to the Metro platform and will not be
recognized
- by generic systems based strictly on the Part API.
- </p>
-
- <subsection name="ComponentModel">
-
- <p>
- The <a
href="/api/dpml/@VERSION@/net/dpml/metro/model/ComponentModel.html">
- net.dpml.metro.ComponentModel</a> interface exposes information about
- a component configuration.
- The <a
href="/api/dpml/@VERSION@/net/dpml/metro/model/MutableComponentModel.html">
- net.dpml.metro.MutableComponentModel</a> interface
- includes additional operations dealing with model changes.
- </p>
-
- <p>
- Attributes exposed by the <tt>ComponentModel</tt> interface:
- </p>
-
- <ul>
- <li>the component name</li>
- <li>the component implementation classname</li>
- <li>activation policy</li>
- <li>lifestyle policy</li>
- <li>garbage collection policy</li>
- <li>classloader chain definition</li>
- <li>keys to internal parts</li>
- <li>access to the component models of internal parts</li>
- <li>logging category priority assignments</li>
- <li>assigned configuration and/or parameterization data</li>
- <li>the context model</li>
- </ul>
-
- </subsection>
-
- <subsection name="ContextModel">
-
- <p>
- The <a
href="/api/dpml/@VERSION@/net/dpml/metro/model/ContextModel.html">
- net.dpml.metro.ContextModel</a> interface
- exposes information about a context settings - specifically the
- binding of context keys to context value directives. The
- <a
href="/api/dpml/@VERSION@/net/dpml/metro/model/MutableContextModel.html">
- net.dpml.metroMutableContextModel</a> provides support for context
entry
- modification.
- </p>
-
- </subsection>
-
- </section>
-
- <section name="Technical Note">
-
- <p>
- Interfaces described here are subject to change. In particular
- listener addition and removal operations are required, together
- with operations dealing with constructor parameter factory
- configuration.
- </p>
-
- </section>
-
- </body>
-
-</document>
-

Modified: trunk/main/central/src/docs/metro/runtime/navigation.xml
===================================================================
--- trunk/main/central/src/docs/metro/runtime/navigation.xml 2006-02-06
21:34:17 UTC (rev 1051)
+++ trunk/main/central/src/docs/metro/runtime/navigation.xml 2006-02-07
06:11:07 UTC (rev 1052)
@@ -26,9 +26,8 @@

<menu>
<item name="Controllers" href="controller/index.html"/>
- <item name="Models" href="models.html"/>
<item name="Components" href="components/index.html"/>
- <item name="Parts" href="parts/index.html"/>
+ <item name="Directives" href="parts/index.html"/>
<item name="Types" href="types.html"/>
<item name="CLI" href="cli/index.html"/>
</menu>

Modified: trunk/main/central/src/docs/metro/tasks/navigation.xml
===================================================================
--- trunk/main/central/src/docs/metro/tasks/navigation.xml 2006-02-06
21:34:17 UTC (rev 1051)
+++ trunk/main/central/src/docs/metro/tasks/navigation.xml 2006-02-07
06:11:07 UTC (rev 1052)
@@ -25,8 +25,8 @@
<body>

<menu>
- <item name="Types" href="types/index.html"/>
- <item name="Components" href="components/index.html"/>
+ <item name="Type" href="types/index.html"/>
+ <item name="Component" href="components/index.html"/>
<item name="Catalog" href="catalog/index.html"/>
<item name="Graph" href="graph/index.html"/>
</menu>

Modified:
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/DefaultComponentHandler.java
===================================================================
---
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/DefaultComponentHandler.java
2006-02-06 21:34:17 UTC (rev 1051)
+++
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/DefaultComponentHandler.java
2006-02-07 06:11:07 UTC (rev 1052)
@@ -136,7 +136,7 @@

//--------------------------------------------------------------------------
// mutable state

//--------------------------------------------------------------------------
-
+
private boolean m_active = false;


//--------------------------------------------------------------------------
@@ -822,8 +822,7 @@
{
try
{
- DefaultProvider provider = new DefaultProvider( this,
getLogger() );
- return provider;
+ return new DefaultProvider( this, getLogger() );
}
catch( RemoteException e )
{
@@ -900,22 +899,16 @@

DefaultProvider getProvider() throws ControlException,
InvocationTargetException
{
- if( m_reference == null )
+ DefaultProvider provider = (DefaultProvider) m_reference.get();
+ if( null == provider )
{
- getLogger().error( "null reference" );
- throw new IllegalStateException( "disposed" );
+ provider = createDefaultProvider();
+ m_reference = createReference( provider );
+ return provider;
}
-
- DefaultProvider instance = (DefaultProvider) m_reference.get();
- if( null == instance )
- {
- instance = createDefaultProvider();
- m_reference = createReference( instance );
- return instance;
- }
else
{
- return instance;
+ return provider;
}
}

@@ -923,10 +916,10 @@
{
if( !isDisposed() )
{
- DefaultProvider instance = (DefaultProvider)
m_reference.get();
- if( instance != null )
+ DefaultProvider provider = (DefaultProvider)
m_reference.get();
+ if( provider != null )
{
- instance.dispose();
+ provider.dispose();
}
m_reference.clear();
super.dispose();
@@ -1089,29 +1082,29 @@
// otherwise use SOFT collection as the SYSTEM default
//

- if( policy.equals( CollectionPolicy.SYSTEM ) )
+ if( policy.equals( CollectionPolicy.SOFT ) )
{
- if( null == m_parent )
- {
- return new HardReference( object );
- }
- else
- {
- return new SoftReference( object );
- }
- }
- else if( policy.equals( CollectionPolicy.SOFT ) )
- {
return new SoftReference( object );
}
else if( policy.equals( CollectionPolicy.WEAK ) )
{
return new WeakReference( object );
}
- else
+ else if( policy.equals( CollectionPolicy.HARD ) )
{
return new HardReference( object );
}
+ else // SYSTEM
+ {
+ if( null == m_parent )
+ {
+ return new HardReference( object );
+ }
+ else
+ {
+ return new SoftReference( object );
+ }
+ }
}
catch( RemoteException e )
{

Modified:
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/DefaultProvider.java
===================================================================
---
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/DefaultProvider.java
2006-02-06 21:34:17 UTC (rev 1051)
+++
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/DefaultProvider.java
2006-02-07 06:11:07 UTC (rev 1052)
@@ -92,6 +92,11 @@
* The available state.
*/
private boolean m_activated = false;
+
+ /**
+ * The available state.
+ */
+ private boolean m_disposed = false;

//-------------------------------------------------------------------
// constructor
@@ -123,11 +128,11 @@
m_machine.addPropertyChangeListener( new StateEventPropergator( this
) );
initialize();
}
-
+
//-------------------------------------------------------------------
// Provider
//-------------------------------------------------------------------
-
+
/**
* Returns the current state of the instance.
* @return the current runtime state
@@ -333,6 +338,11 @@
{
synchronized( getLock() )
{
+ if( m_disposed )
+ {
+ return;
+ }
+ m_disposed = true;
getLogger().debug( m_tag + "instance disposal" );
deactivate();
m_machine.dispose();

Modified: trunk/main/metro/test/build.xml
===================================================================
--- trunk/main/metro/test/build.xml 2006-02-06 21:34:17 UTC (rev 1051)
+++ trunk/main/metro/test/build.xml 2006-02-07 06:11:07 UTC (rev 1052)
@@ -99,21 +99,21 @@
</c:component>

<c:component dest="target/test/example-3.part" test="true"
- type="net.dpml.test.SingletonComponent" name="singleton"
collection="weak">
+ type="net.dpml.test.SingletonComponent" lifestyle="SINGLETON"
collection="WEAK">
<context>
<entry key="color" method="RED"/>
</context>
</c:component>

<c:component dest="target/test/example-4.part" test="true"
- type="net.dpml.test.SingletonComponent" name="singleton"
collection="hard">
+ type="net.dpml.test.SingletonComponent" name="singleton"
collection="HARD">
<context>
<entry key="color" method="RED"/>
</context>
</c:component>

<c:component dest="target/test/context.part" test="true"
- type="net.dpml.test.ContextTestComponent" name="context"
collection="soft">
+ type="net.dpml.test.ContextTestComponent" name="context"
collection="SOFT">
<context>
<entry key="color" method="RED"/>
<entry key="integer" value="0"/>
@@ -157,14 +157,14 @@
</types>

<c:component dest="target/test/composite.part" test="true"
- type="net.dpml.test.composite.CompositeComponent" collection="hard">
+ type="net.dpml.test.composite.CompositeComponent" collection="HARD">
<context>
<entry key="color" method="RED"/>
</context>
</c:component>

<c:component dest="target/test/parts.part" test="true"
- type="net.dpml.test.composite.PartsComponent" collection="hard">
+ type="net.dpml.test.composite.PartsComponent" collection="HARD">
<context>
<entry key="color" method="RED"/>
</context>
@@ -196,7 +196,7 @@
</c:type>

<c:component dest="target/test/lifecycle.part" test="true"
- type="net.dpml.test.lifecycle.StartableComponent" collection="hard">
+ type="net.dpml.test.lifecycle.StartableComponent" collection="HARD">
</c:component>

<!-- categories component -->




  • r1052 - in trunk/main: central/src/docs/metro/runtime central/src/docs/metro/runtime/components central/src/docs/metro/tasks metro/runtime/src/main/net/dpml/metro/runtime metro/test, mcconnell at BerliOS, 02/07/2006

Archive powered by MHonArc 2.6.24.

Top of Page