notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
svn commit: r2414 - in development/main/metro/composition/control/src/main/net/dpml/composition: control model
- From: mcconnell AT dpml.net
- To: notify-dpml AT lists.ibiblio.org
- Subject: svn commit: r2414 - in development/main/metro/composition/control/src/main/net/dpml/composition: control model
- Date: Tue, 26 Apr 2005 08:03:54 -0400
Author: mcconnell AT dpml.net
Date: Tue Apr 26 08:03:29 2005
New Revision: 2414
Added:
development/main/metro/composition/control/src/main/net/dpml/composition/model/ComponentModel.java
- copied, changed from r2413,
development/main/metro/composition/control/src/main/net/dpml/composition/control/Holder.java
Removed:
development/main/metro/composition/control/src/main/net/dpml/composition/control/Holder.java
Modified:
development/main/metro/composition/control/src/main/net/dpml/composition/control/ComponentController.java
development/main/metro/composition/control/src/main/net/dpml/composition/control/CompositionController.java
development/main/metro/composition/control/src/main/net/dpml/composition/control/ContextInvocationHandler.java
development/main/metro/composition/control/src/main/net/dpml/composition/control/ContextManagerInvocationHandler.java
development/main/metro/composition/control/src/main/net/dpml/composition/control/InstanceTable.java
development/main/metro/composition/control/src/main/net/dpml/composition/control/LifecycleHandler.java
development/main/metro/composition/control/src/main/net/dpml/composition/control/LifestyleHandler.java
development/main/metro/composition/control/src/main/net/dpml/composition/control/ManagerInvocationHandler.java
development/main/metro/composition/control/src/main/net/dpml/composition/control/PartsInvocationHandler.java
Log:
renaming and reshuffling related to the separation of component control from
component model
Modified:
development/main/metro/composition/control/src/main/net/dpml/composition/control/ComponentController.java
==============================================================================
---
development/main/metro/composition/control/src/main/net/dpml/composition/control/ComponentController.java
(original)
+++
development/main/metro/composition/control/src/main/net/dpml/composition/control/ComponentController.java
Tue Apr 26 08:03:29 2005
@@ -39,6 +39,7 @@
import net.dpml.composition.state.*;
import net.dpml.composition.model.CompositionModel;
+import net.dpml.composition.model.ComponentModel;
import net.dpml.composition.event.AvailabilityEvent;
import net.dpml.activity.Executable;
@@ -63,7 +64,7 @@
*
* @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
*/
-public class ComponentController extends Holder implements Manager
+public class ComponentController extends ComponentModel implements Manager
{
private final Vector m_listeners = new Vector();
private final Map m_handlers = new Hashtable();
Modified:
development/main/metro/composition/control/src/main/net/dpml/composition/control/CompositionController.java
==============================================================================
---
development/main/metro/composition/control/src/main/net/dpml/composition/control/CompositionController.java
(original)
+++
development/main/metro/composition/control/src/main/net/dpml/composition/control/CompositionController.java
Tue Apr 26 08:03:29 2005
@@ -33,6 +33,7 @@
import net.dpml.composition.data.ClasspathDirective;
import net.dpml.composition.data.ComponentProfile;
import net.dpml.composition.data.ValueDirective;
+import net.dpml.composition.model.ComponentModel;
import net.dpml.composition.model.CompositionModel;
import net.dpml.composition.model.ValueModel;
@@ -475,7 +476,7 @@
return m_system.getLoggingManager().getLoggerForCategory( path );
}
- public Object incarnate( Holder holder ) throws LifecycleException,
InvocationTargetException
+ public Object incarnate( ComponentModel holder ) throws
LifecycleException, InvocationTargetException
{
return m_lifecycleHandler.incarnate( holder );
}
Modified:
development/main/metro/composition/control/src/main/net/dpml/composition/control/ContextInvocationHandler.java
==============================================================================
---
development/main/metro/composition/control/src/main/net/dpml/composition/control/ContextInvocationHandler.java
(original)
+++
development/main/metro/composition/control/src/main/net/dpml/composition/control/ContextInvocationHandler.java
Tue Apr 26 08:03:29 2005
@@ -26,6 +26,7 @@
import net.dpml.parts.model.ModelException;
import net.dpml.parts.state.StateListener;
+import net.dpml.composition.model.ComponentModel;
import net.dpml.composition.model.CompositionModel;
import net.dpml.system.SystemContext;
@@ -52,7 +53,7 @@
/**
* The component model.
*/
- private final Holder m_holder;
+ private final ComponentModel m_holder;
//-------------------------------------------------------------------
// constructor
@@ -64,7 +65,7 @@
* @param system the system context
* @param model the component model
*/
- ContextInvocationHandler( SystemContext system, Holder holder )
+ ContextInvocationHandler( SystemContext system, ComponentModel holder )
throws LifecycleException, ModelException
{
m_system = system;
@@ -106,7 +107,7 @@
if( name.startsWith( "get" ) )
{
String key = getKeyFromMethod( method );
- Holder.ContextMap map = getHolder().getContextMap();
+ ComponentModel.ContextMap map = getHolder().getContextMap();
return map.getValue( key, args );
}
else if( null != args )
@@ -170,7 +171,7 @@
return first + remainder;
}
- Holder getHolder()
+ ComponentModel getHolder()
{
return m_holder;
}
Modified:
development/main/metro/composition/control/src/main/net/dpml/composition/control/ContextManagerInvocationHandler.java
==============================================================================
---
development/main/metro/composition/control/src/main/net/dpml/composition/control/ContextManagerInvocationHandler.java
(original)
+++
development/main/metro/composition/control/src/main/net/dpml/composition/control/ContextManagerInvocationHandler.java
Tue Apr 26 08:03:29 2005
@@ -21,6 +21,8 @@
import java.lang.reflect.Method;
import java.util.Map;
+import net.dpml.composition.model.ComponentModel;
+
import net.dpml.parts.control.LifecycleException;
import net.dpml.parts.model.ModelException;
@@ -47,7 +49,7 @@
* @param model the component model
*/
ContextManagerInvocationHandler(
- SystemContext system, Holder holder )
+ SystemContext system, ComponentModel holder )
throws LifecycleException, ModelException
{
super( system, holder );
Modified:
development/main/metro/composition/control/src/main/net/dpml/composition/control/InstanceTable.java
==============================================================================
---
development/main/metro/composition/control/src/main/net/dpml/composition/control/InstanceTable.java
(original)
+++
development/main/metro/composition/control/src/main/net/dpml/composition/control/InstanceTable.java
Tue Apr 26 08:03:29 2005
@@ -22,6 +22,7 @@
import java.util.Map;
import java.util.WeakHashMap;
+import net.dpml.composition.model.ComponentModel;
import net.dpml.composition.model.CompositionModel;
/**
@@ -46,7 +47,7 @@
m_controller = controller;
}
- public void add( Holder holder )
+ public void add( ComponentModel holder )
{
if( null == holder )
{
@@ -55,7 +56,7 @@
m_holders.put( holder, holder.getModel() );
}
- public Holder get( CompositionModel model, Object key )
+ public ComponentModel get( CompositionModel model, Object key )
{
if( null == key )
{
@@ -63,10 +64,10 @@
}
synchronized( m_holders )
{
- Holder[] holders = (Holder[]) m_holders.keySet().toArray( new
Holder[0] );
+ ComponentModel[] holders = (ComponentModel[])
m_holders.keySet().toArray( new ComponentModel[0] );
for( int i=0; i<holders.length; i++ )
{
- Holder holder = holders[i];
+ ComponentModel holder = holders[i];
CompositionModel m = holder.getModel();
if( key.equals( holder.getKey() ) && m.equals( model ) )
{
@@ -77,12 +78,12 @@
}
}
- private Holder[] list()
+ private ComponentModel[] list()
{
- return (Holder[]) m_holders.keySet().toArray( new Holder[0] );
+ return (ComponentModel[]) m_holders.keySet().toArray( new
ComponentModel[0] );
}
- public void remove( Holder holder )
+ public void remove( ComponentModel holder )
{
m_holders.remove( holder );
}
@@ -91,7 +92,7 @@
{
synchronized( m_holders )
{
- Holder holder = get( model, key );
+ ComponentModel holder = get( model, key );
if( null != holder )
{
remove( holder );
@@ -116,15 +117,15 @@
{
return false;
}
- Holder[] mine = list();
- Holder[] yours = table.list();
+ ComponentModel[] mine = list();
+ ComponentModel[] yours = table.list();
if( mine.length != yours.length )
{
return false;
}
for( int i=0; i<mine.length; i++ )
{
- Holder holder = mine[i];
+ ComponentModel holder = mine[i];
if( false == holder.equals( yours[i] ) )
{
return false;
@@ -137,10 +138,10 @@
public int hashCode()
{
int hash = m_controller.hashCode();
- Holder[] holders = list();
+ ComponentModel[] holders = list();
for( int i=0; i<holders.length; i++ )
{
- Holder holder = holders[i];
+ ComponentModel holder = holders[i];
hash ^= holder.hashCode();
}
return hash;
Modified:
development/main/metro/composition/control/src/main/net/dpml/composition/control/LifecycleHandler.java
==============================================================================
---
development/main/metro/composition/control/src/main/net/dpml/composition/control/LifecycleHandler.java
(original)
+++
development/main/metro/composition/control/src/main/net/dpml/composition/control/LifecycleHandler.java
Tue Apr 26 08:03:29 2005
@@ -33,6 +33,7 @@
import net.dpml.composition.info.Type;
import net.dpml.composition.model.CompositionModel;
+import net.dpml.composition.model.ComponentModel;
import net.dpml.configuration.Configuration;
@@ -96,7 +97,7 @@
*
* @return a new component instance
*/
- public Object incarnate( Holder holder ) throws LifecycleException,
InvocationTargetException
+ public Object incarnate( ComponentModel holder ) throws
LifecycleException, InvocationTargetException
{
if( getMonitor().isDebugEnabled() )
{
@@ -175,7 +176,7 @@
* @return the state manager (possibly null)
*/
/*
- public Manager getManager( Holder holder ) throws LifecycleException,
InvocationTargetException
+ public Manager getManager( ComponentModel holder ) throws
LifecycleException, InvocationTargetException
{
if( getMonitor().isDebugEnabled() )
{
@@ -351,7 +352,7 @@
}
}
- private Object newContextInvocationHandler( Holder holder, Class clazz )
throws LifecycleRuntimeException
+ private Object newContextInvocationHandler( ComponentModel holder, Class
clazz ) throws LifecycleRuntimeException
{
try
{
@@ -367,7 +368,7 @@
}
}
- private Object newPartsInvocationHandler( Holder holder, Class clazz )
throws LifecycleException
+ private Object newPartsInvocationHandler( ComponentModel holder, Class
clazz ) throws LifecycleException
{
try
{
Modified:
development/main/metro/composition/control/src/main/net/dpml/composition/control/LifestyleHandler.java
==============================================================================
---
development/main/metro/composition/control/src/main/net/dpml/composition/control/LifestyleHandler.java
(original)
+++
development/main/metro/composition/control/src/main/net/dpml/composition/control/LifestyleHandler.java
Tue Apr 26 08:03:29 2005
@@ -20,6 +20,7 @@
import java.lang.reflect.InvocationTargetException;
+import net.dpml.composition.model.ComponentModel;
import net.dpml.composition.model.CompositionModel;
import net.dpml.parts.control.LifecycleException;
@@ -49,7 +50,7 @@
* @param model the model from which new or existing instances will be
resolved
* @return the key to the resolved instance
*/
- public Holder aquire( CompositionModel model, Object owner ) throws
Exception
+ public ComponentModel aquire( CompositionModel model, Object owner )
throws Exception
{
final String lifestyle = model.getLifestylePolicy();
if( getMonitor().isDebugEnabled() )
@@ -66,7 +67,7 @@
{
synchronized( model )
{
- Holder holder = new ComponentController( m_monitor, model,
null, owner );
+ ComponentModel holder = new ComponentController( m_monitor,
model, null, owner );
Object key = holder.getKey();
if( getMonitor().isDebugEnabled() )
{
@@ -111,7 +112,7 @@
* @param model the model from which new or existing instances will be
resolved
* @return the key to the resolved instance
*/
- public Holder aquire( CompositionModel model, Object key, Object owner )
+ public ComponentModel aquire( CompositionModel model, Object key, Object
owner )
throws Exception
{
if( null == model )
@@ -122,7 +123,7 @@
{
throw new NullPointerException( "key" );
}
- Holder holder =
model.getCompositionController().getInstanceTable().get( model, key );
+ ComponentModel holder =
model.getCompositionController().getInstanceTable().get( model, key );
if( null == holder )
{
Modified:
development/main/metro/composition/control/src/main/net/dpml/composition/control/ManagerInvocationHandler.java
==============================================================================
---
development/main/metro/composition/control/src/main/net/dpml/composition/control/ManagerInvocationHandler.java
(original)
+++
development/main/metro/composition/control/src/main/net/dpml/composition/control/ManagerInvocationHandler.java
Tue Apr 26 08:03:29 2005
@@ -31,6 +31,7 @@
import net.dpml.composition.data.ValueDirective;
import net.dpml.composition.state.DefaultState;
+import net.dpml.composition.model.ComponentModel;
import net.dpml.lang.DelegationRuntimeException;
@@ -55,7 +56,7 @@
// state
//-------------------------------------------------------------------
- private final Holder m_holder;
+ private final ComponentModel m_holder;
private final Object m_manager;
private final Class m_class;
@@ -69,7 +70,7 @@
* @param system the system context
* @param model the component model
*/
- ManagerInvocationHandler( Holder holder, Object manager )
+ ManagerInvocationHandler( ComponentModel holder, Object manager )
{
m_holder = holder;
m_manager = manager;
Modified:
development/main/metro/composition/control/src/main/net/dpml/composition/control/PartsInvocationHandler.java
==============================================================================
---
development/main/metro/composition/control/src/main/net/dpml/composition/control/PartsInvocationHandler.java
(original)
+++
development/main/metro/composition/control/src/main/net/dpml/composition/control/PartsInvocationHandler.java
Tue Apr 26 08:03:29 2005
@@ -30,6 +30,7 @@
import net.dpml.parts.model.Model;
import net.dpml.composition.model.CompositionModel;
+import net.dpml.composition.model.ComponentModel;
import net.dpml.composition.info.PartDescriptor;
@@ -62,7 +63,7 @@
/**
* The component model.
*/
- private final Holder m_holder;
+ private final ComponentModel m_holder;
/**
* The system context.
@@ -78,7 +79,7 @@
*
* @param model the component model
*/
- PartsInvocationHandler( SystemContext system, Holder holder )
+ PartsInvocationHandler( SystemContext system, ComponentModel holder )
throws NullPointerException
{
m_holder = holder;
@@ -227,7 +228,7 @@
CompositionModel model = (CompositionModel) provider;
Controller controller = model.getController();
- Holder holder = getHolder( model, args, proxy );
+ ComponentModel holder = getHolder( model, args, proxy );
ClassLoader classloader = model.getClassLoader();
SystemContext system = getSystemContext();
ContextManagerInvocationHandler handler =
@@ -260,7 +261,7 @@
/*
CompositionModel model = (CompositionModel) provider;
Controller controller = model.getController();
- Holder holder = getHolder( model, args );
+ ComponentModel holder = getHolder( model, args );
Manager manager = holder.getManager();
if( null == manager )
{
@@ -408,9 +409,9 @@
}
}
- private Holder getHolder( CompositionModel model, Object[] args, Object
owner ) throws Exception
+ private ComponentModel getHolder( CompositionModel model, Object[] args,
Object owner ) throws Exception
{
- return (Holder) getManager( model, args, owner );
+ return (ComponentModel) getManager( model, args, owner );
}
private Manager getManager( CompositionModel model, Object[] args,
Object owner ) throws Exception
Copied:
development/main/metro/composition/control/src/main/net/dpml/composition/model/ComponentModel.java
(from r2413,
development/main/metro/composition/control/src/main/net/dpml/composition/control/Holder.java)
==============================================================================
---
development/main/metro/composition/control/src/main/net/dpml/composition/control/Holder.java
(original)
+++
development/main/metro/composition/control/src/main/net/dpml/composition/model/ComponentModel.java
Tue Apr 26 08:03:29 2005
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package net.dpml.composition.control;
+package net.dpml.composition.model;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
@@ -31,14 +31,14 @@
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
-import net.dpml.composition.model.CompositionModel;
-import net.dpml.composition.model.ContextTable;
+import net.dpml.composition.control.CompositionController;
import net.dpml.lang.ResourceUnavailableException;
import net.dpml.parts.control.Identifiable;
import net.dpml.parts.control.LifecycleException;
import net.dpml.parts.control.Monitor;
+
import net.dpml.parts.state.StateListener;
/**
@@ -50,7 +50,7 @@
* @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
* @version $Id: LifestyleManager.java 259 2004-10-30 07:24:40Z mcconnell $
*/
-public abstract class Holder extends Observable implements Entry,
Identifiable
+public abstract class ComponentModel extends Observable implements Entry,
Identifiable
{
private final Map m_proxies = new WeakHashMap();
@@ -62,8 +62,7 @@
private boolean m_disposed = false;
- public Holder(
- Monitor monitor, CompositionModel model, Object key )
+ public ComponentModel( Monitor monitor, CompositionModel model, Object
key )
throws LifecycleException, InvocationTargetException
{
m_monitor = monitor;
- svn commit: r2414 - in development/main/metro/composition/control/src/main/net/dpml/composition: control model, mcconnell, 04/25/2005
Archive powered by MHonArc 2.6.24.