notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
svn commit: r2434 - in development/main/metro/composition: builder/src/main/net/dpml/composition/builder control/src/main/net/dpml/composition/control part/src/main/net/dpml/composition/info part/src/test/net/dpml/composition/info/test testing/acme/src/main/net/dpml/composition/testing testing/test/src/main/net/dpml/test/config testing/test/src/main/net/dpml/test/state
- From: mcconnell AT dpml.net
- To: notify-dpml AT lists.ibiblio.org
- Subject: svn commit: r2434 - in development/main/metro/composition: builder/src/main/net/dpml/composition/builder control/src/main/net/dpml/composition/control part/src/main/net/dpml/composition/info part/src/test/net/dpml/composition/info/test testing/acme/src/main/net/dpml/composition/testing testing/test/src/main/net/dpml/test/config testing/test/src/main/net/dpml/test/state
- Date: Thu, 28 Apr 2005 05:34:54 -0400
Author: mcconnell AT dpml.net
Date: Thu Apr 28 05:34:52 2005
New Revision: 2434
Modified:
development/main/metro/composition/builder/src/main/net/dpml/composition/builder/TypeBuilderTask.java
development/main/metro/composition/control/src/main/net/dpml/composition/control/PartsInvocationHandler.java
development/main/metro/composition/part/src/main/net/dpml/composition/info/PartDescriptor.java
development/main/metro/composition/part/src/test/net/dpml/composition/info/test/PartDescriptorTestCase.java
development/main/metro/composition/part/src/test/net/dpml/composition/info/test/TypeTestCase.java
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/AcmeContainer.java
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/ExampleContainer.java
development/main/metro/composition/testing/test/src/main/net/dpml/test/config/ConfigurableContainer.java
development/main/metro/composition/testing/test/src/main/net/dpml/test/state/ManagingContainer.java
Log:
switch parts semantic keyword from "select" to "get"
Modified:
development/main/metro/composition/builder/src/main/net/dpml/composition/builder/TypeBuilderTask.java
==============================================================================
---
development/main/metro/composition/builder/src/main/net/dpml/composition/builder/TypeBuilderTask.java
(original)
+++
development/main/metro/composition/builder/src/main/net/dpml/composition/builder/TypeBuilderTask.java
Thu Apr 28 05:34:52 2005
@@ -534,7 +534,7 @@
{
final String name = method.getName();
final int semantic = PartDescriptor.getPartSemantic( method );
- if( semantic == PartDescriptor.SELECT )
+ if( semantic == PartDescriptor.GET )
{
validateNoExceptions( method );
Class returnType = method.getReturnType();
@@ -556,7 +556,7 @@
{
validateSelectPattern( method );
}
- return new Operation( PartDescriptor.SELECT, postfix, type );
+ return new Operation( PartDescriptor.GET, postfix, type );
}
else if( semantic == PartDescriptor.RELEASE )
{
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
Thu Apr 28 05:34:52 2005
@@ -149,7 +149,7 @@
String key = PartDescriptor.getPartKey( method, semantic );
Model provider = getModel().getPartsTable().getModel( key );
- if( PartDescriptor.SELECT == semantic )
+ if( PartDescriptor.GET == semantic )
{
if( null == postfix )
{
Modified:
development/main/metro/composition/part/src/main/net/dpml/composition/info/PartDescriptor.java
==============================================================================
---
development/main/metro/composition/part/src/main/net/dpml/composition/info/PartDescriptor.java
(original)
+++
development/main/metro/composition/part/src/main/net/dpml/composition/info/PartDescriptor.java
Thu Apr 28 05:34:52 2005
@@ -56,10 +56,10 @@
public final class PartDescriptor
implements Serializable
{
- public static final int SELECT = 1;
+ public static final int GET = 1;
public static final int RELEASE = -1;
- public static final String SELECT_KEY = "select";
+ public static final String GET_KEY = "get";
public static final String RELEASE_KEY = "release";
public static final String CONTEXT_MAP_KEY = "ContextMap";
@@ -69,13 +69,13 @@
public static String toString( int semantic )
{
- if( SELECT == semantic )
+ if( GET == semantic )
{
- return "select";
+ return GET_KEY;
}
else if( RELEASE == semantic )
{
- return "release";
+ return RELEASE_KEY;
}
else
{
@@ -111,9 +111,9 @@
public static int getPartSemantic( Method method )
{
String name = method.getName();
- if( name.startsWith( SELECT_KEY ) )
+ if( name.startsWith( GET_KEY ) )
{
- return SELECT;
+ return GET;
}
else if( name.startsWith( RELEASE_KEY ) )
{
@@ -138,39 +138,39 @@
public static String getPartKey( Method method, int semantic )
{
String name = method.getName();
- if( SELECT == semantic )
+ if( GET == semantic )
{
if( name.endsWith( CONTEXT_MANAGER_KEY ) )
{
int n = CONTEXT_MANAGER_KEY.length();
int j = name.length() - n;
String substring = name.substring( 0, j );
- return formatKey( substring, 6 );
+ return formatKey( substring, 3 );
}
else if( name.endsWith( CONTEXT_MAP_KEY ) )
{
int n = CONTEXT_MAP_KEY.length();
int j = name.length() - n;
String substring = name.substring( 0, j );
- return formatKey( substring, 6 );
+ return formatKey( substring, 3 );
}
else if( name.endsWith( MODEL_KEY ) )
{
int n = MODEL_KEY.length();
int j = name.length() - n;
String substring = name.substring( 0, j );
- return formatKey( substring, 6 );
+ return formatKey( substring, 3 );
}
else if( name.endsWith( COMPONENT_KEY ) )
{
int n = COMPONENT_KEY.length();
int j = name.length() - n;
String substring = name.substring( 0, j );
- return formatKey( substring, 6 );
+ return formatKey( substring, 3 );
}
else
{
- return formatKey( name, 6 );
+ return formatKey( name, 3 );
}
}
else if( RELEASE == semantic )
@@ -273,7 +273,7 @@
for( int i=0; i<operations.length; i++ )
{
Operation operation = operations[i];
- if( SELECT == operation.getSemantic() )
+ if( GET == operation.getSemantic() )
{
if( null == operation.getPostfix() )
{
@@ -428,7 +428,6 @@
}
}
-
private static String formatKey( String method, int offset )
{
String string = method.substring( offset );
Modified:
development/main/metro/composition/part/src/test/net/dpml/composition/info/test/PartDescriptorTestCase.java
==============================================================================
---
development/main/metro/composition/part/src/test/net/dpml/composition/info/test/PartDescriptorTestCase.java
(original)
+++
development/main/metro/composition/part/src/test/net/dpml/composition/info/test/PartDescriptorTestCase.java
Thu Apr 28 05:34:52 2005
@@ -41,7 +41,7 @@
{
private static final String m_key = "key";
private static final String m_type = PartDescriptor.class.getName();
- private static final int m_semantic = PartDescriptor.SELECT;
+ private static final int m_semantic = PartDescriptor.GET;
private static final Operation m_operation = new Operation( m_semantic,
m_type );
private static final Operation[] m_operations = new Operation[]{
m_operation };
Modified:
development/main/metro/composition/part/src/test/net/dpml/composition/info/test/TypeTestCase.java
==============================================================================
---
development/main/metro/composition/part/src/test/net/dpml/composition/info/test/TypeTestCase.java
(original)
+++
development/main/metro/composition/part/src/test/net/dpml/composition/info/test/TypeTestCase.java
Thu Apr 28 05:34:52 2005
@@ -87,7 +87,7 @@
};
m_defaults = new DefaultConfiguration("default");
m_parts = new PartDescriptor[] {
- new PartDescriptor( "key", new Operation[]{ new Operation(
PartDescriptor.SELECT, ReferenceDescriptor.class.getName() ) } )
+ new PartDescriptor( "key", new Operation[]{ new Operation(
PartDescriptor.GET, ReferenceDescriptor.class.getName() ) } )
};
}
Modified:
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/AcmeContainer.java
==============================================================================
---
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/AcmeContainer.java
(original)
+++
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/AcmeContainer.java
Thu Apr 28 05:34:52 2005
@@ -83,11 +83,11 @@
//
getLogger().info( "getting widget context manager" );
- ColorContext.Manager manager = parts.selectGizmoContextManager();
+ ColorContext.Manager manager = parts.getGizmoContextManager();
String color = manager.getColor( "purple" );
manager.setColor( color );
- Gizmo gizmo = parts.selectGizmo();
+ Gizmo gizmo = parts.getGizmo();
gizmo.doGizmoStuff();
//
@@ -100,7 +100,7 @@
int width = m_context.getWidth( 1 );
int height = m_context.getWidth( 5 );
Dimension d = new DimensionValue( width, height );
- Map map = parts.selectWidgetContextMap();
+ Map map = parts.getWidgetContextMap();
map.put( "dimension", d );
manager.setColor( "white" );
gizmo.doGizmoStuff();
@@ -111,10 +111,10 @@
//
debug( "getting identified gizmo" );
- Gizmo myGizmo = parts.selectGizmo( "my-gizmo" );
+ Gizmo myGizmo = parts.getGizmo( "my-gizmo" );
debug( "getting identified non-proxied gizmo" );
- Gizmo myProxiedGizmo = parts.selectGizmo( "my-gizmo", true );
+ Gizmo myProxiedGizmo = parts.getGizmo( "my-gizmo", true );
debug( "cleaning up" );
parts.releaseGizmo( gizmo );
@@ -147,14 +147,14 @@
*
* @return the widget service
*/
- Widget selectWidget();
+ Widget getWidget();
/**
* Return the widget's context manager.
*
* @return the widget context manager
*/
- Map selectWidgetContextMap();
+ Map getWidgetContextMap();
/**
* Return an instance of gizmo using the lifestyle policy
@@ -162,14 +162,14 @@
*
* @return the gizmo service
*/
- Gizmo selectGizmo();
+ Gizmo getGizmo();
/**
* Return the gizmo context manager.
*
* @return the gizmo context manager
*/
- ColorContext.Manager selectGizmoContextManager();
+ ColorContext.Manager getGizmoContextManager();
/**
* Return an identified instance of gizmo.
@@ -177,7 +177,7 @@
* @param key the instance identifier
* @return the gizmo service
*/
- Gizmo selectGizmo( Object key );
+ Gizmo getGizmo( Object key );
/**
* Return an identified instance of gizmo using a supplied proxy
policy.
@@ -185,7 +185,7 @@
* @param key the instance identifier
* @return the gizmo service
*/
- Gizmo selectGizmo( Object key, boolean policy );
+ Gizmo getGizmo( Object key, boolean policy );
/**
* Optional release of an instance of the gizmo component.
Modified:
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/ExampleContainer.java
==============================================================================
---
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/ExampleContainer.java
(original)
+++
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/ExampleContainer.java
Thu Apr 28 05:34:52 2005
@@ -81,15 +81,15 @@
int width = m_context.getWidth( 9 );
int height = m_context.getHeight( 7 );
DimensionalContext.Manager manager =
- m_parts.selectDimensionContextManager();
+ m_parts.getDimensionContextManager();
manager.setHeight( height );
manager.setWidth( width );
- //Map map = m_parts.selectDimensionContextMap();
+ //Map map = m_parts.getDimensionContextMap();
//map.put( "height", new Integer( height ) );
//map.put( "width", new Integer( width ) );
- Dimension dimension = m_parts.selectDimension();
+ Dimension dimension = m_parts.getDimension();
int size = dimension.getSize();
m_logger.info(
"Creating a widget with a area of " + size );
@@ -103,8 +103,8 @@
public interface Parts
{
- DimensionalContext.Manager selectDimensionContextManager();
- Map selectDimensionContextMap();
- Dimension selectDimension();
+ DimensionalContext.Manager getDimensionContextManager();
+ Map getDimensionContextMap();
+ Dimension getDimension();
}
}
Modified:
development/main/metro/composition/testing/test/src/main/net/dpml/test/config/ConfigurableContainer.java
==============================================================================
---
development/main/metro/composition/testing/test/src/main/net/dpml/test/config/ConfigurableContainer.java
(original)
+++
development/main/metro/composition/testing/test/src/main/net/dpml/test/config/ConfigurableContainer.java
Thu Apr 28 05:34:52 2005
@@ -80,7 +80,7 @@
public void execute() throws Exception
{
Parts parts = getParts();
- Model model = parts.selectTestModel();
+ Model model = parts.getTestModel();
if( model instanceof Configurable )
{
Configuration conf = m_configuration.getChild( "test", false );
@@ -109,6 +109,6 @@
public interface Parts
{
- Model selectTestModel();
+ Model getTestModel();
}
}
Modified:
development/main/metro/composition/testing/test/src/main/net/dpml/test/state/ManagingContainer.java
==============================================================================
---
development/main/metro/composition/testing/test/src/main/net/dpml/test/state/ManagingContainer.java
(original)
+++
development/main/metro/composition/testing/test/src/main/net/dpml/test/state/ManagingContainer.java
Thu Apr 28 05:34:52 2005
@@ -77,7 +77,7 @@
public void execute() throws Exception
{
Parts parts = getParts();
- Component component = parts.selectTestComponent();
+ Component component = parts.getTestComponent();
component.initialize();
component.apply( "start" );
component.execute( "audit" );
@@ -100,6 +100,6 @@
public interface Parts
{
- Component selectTestComponent();
+ Component getTestComponent();
}
}
- svn commit: r2434 - in development/main/metro/composition: builder/src/main/net/dpml/composition/builder control/src/main/net/dpml/composition/control part/src/main/net/dpml/composition/info part/src/test/net/dpml/composition/info/test testing/acme/src/main/net/dpml/composition/testing testing/test/src/main/net/dpml/test/config testing/test/src/main/net/dpml/test/state, mcconnell, 04/27/2005
Archive powered by MHonArc 2.6.24.