Skip to Content.
Sympa Menu

notify-dpml - r969 - in trunk/main/metro: model/src/main/net/dpml/metro/control part/api/src/main/net/dpml/part part/api/src/main/net/dpml/part/remote runtime/src/main/net/dpml/metro/runtime

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: r969 - in trunk/main/metro: model/src/main/net/dpml/metro/control part/api/src/main/net/dpml/part part/api/src/main/net/dpml/part/remote runtime/src/main/net/dpml/metro/runtime
  • Date: Tue, 24 Jan 2006 16:48:41 +0100

Author: mcconnell
Date: 2006-01-24 16:48:40 +0100 (Tue, 24 Jan 2006)
New Revision: 969

Added:
trunk/main/metro/part/api/src/main/net/dpml/part/ComponentOperations.java
trunk/main/metro/part/api/src/main/net/dpml/part/ProviderOperations.java

trunk/main/metro/part/api/src/main/net/dpml/part/ServiceNotFoundException.java
Removed:

trunk/main/metro/part/api/src/main/net/dpml/part/remote/ServiceNotFoundException.java
Modified:
trunk/main/metro/model/src/main/net/dpml/metro/control/Handler.java
trunk/main/metro/part/api/src/main/net/dpml/part/remote/Component.java
trunk/main/metro/part/api/src/main/net/dpml/part/remote/Provider.java

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

trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/ComponentHandler.java
Log:
abstract out the common operations between local and remote usage

Modified: trunk/main/metro/model/src/main/net/dpml/metro/control/Handler.java
===================================================================
--- trunk/main/metro/model/src/main/net/dpml/metro/control/Handler.java
2006-01-24 15:32:17 UTC (rev 968)
+++ trunk/main/metro/model/src/main/net/dpml/metro/control/Handler.java
2006-01-24 15:48:40 UTC (rev 969)
@@ -22,6 +22,7 @@
import java.util.Map;

import net.dpml.part.ControlException;
+import net.dpml.part.ComponentOperations;
import net.dpml.part.remote.Provider;

/**
@@ -31,7 +32,7 @@
* @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
* @version @PROJECT-VERSION@
*/
-public interface Handler
+public interface Handler extends ComponentOperations
{
/**
* Return a mutible context map.
@@ -48,6 +49,6 @@
* @exception ControlException if the component could not be established
due to a controller
* related error
*/
- Provider getProvider() throws ControlException,
InvocationTargetException;
+ //Provider getProvider() throws ControlException,
InvocationTargetException;
}


Added:
trunk/main/metro/part/api/src/main/net/dpml/part/ComponentOperations.java
===================================================================
--- trunk/main/metro/part/api/src/main/net/dpml/part/ComponentOperations.java
2006-01-24 15:32:17 UTC (rev 968)
+++ trunk/main/metro/part/api/src/main/net/dpml/part/ComponentOperations.java
2006-01-24 15:48:40 UTC (rev 969)
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2005 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.part;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+import java.lang.reflect.InvocationTargetException;
+
+import net.dpml.part.remote.Component;
+import net.dpml.part.remote.Service;
+import net.dpml.part.remote.Provider;
+
+/**
+ * The ComponentOperations represents the set of operations shared between
+ * local and remote component users.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public interface ComponentOperations
+{
+ /**
+ * Return a handler capable of supporting the requested service.
+ * @param service the service descriptor
+ * @return a component matching the requested service
+ * @exception ServiceNotFoundException if no component could found
+ * @exception RemoteException if a remote I/O occurs
+ */
+ Component lookup( Service service ) throws ServiceNotFoundException,
RemoteException;
+
+ /**
+ * Return true if this handler is a candidate for the supplied service
definition.
+ * @param service the service descriptor
+ * @return true if this is a candidate
+ * @exception RemoteException if a remote exception occurs
+ */
+ boolean isaCandidate( Service service ) throws RemoteException;
+
+ /**
+ * Initiate activation of a runtime handler.
+ * @exception ControlException if an activation error occurs
+ * @exception InvocationTargetException if the component declares
activation on startup
+ * and a implementation source exception occured
+ * @exception RemoteException if a remote exception occurs
+ */
+ void activate() throws ControlException, InvocationTargetException,
RemoteException;
+
+ /**
+ * Returns the active status of the handler.
+ * @return TRUE if the handler has been activated otherwise FALSE
+ * @exception RemoteException if a remote exception occurs
+ */
+ boolean isActive() throws RemoteException;
+
+ /**
+ * Return the number of instances currently under management.
+ * @return the instance count.
+ * @exception RemoteException if a remote exception occurs
+ */
+ int size() throws RemoteException;
+
+ /**
+ * Return a reference to a instance of the component handled by the
handler.
+ * @return the instance holder
+ * @exception InvocationTargetException if the component instantiation
process
+ * is on demand and an target invocation error occurs
+ * @exception ControlException if the component could not be established
due to a controller
+ * related error
+ * @exception RemoteException if a remote exception occurs
+ */
+ Provider getProvider() throws ControlException,
InvocationTargetException, RemoteException;
+
+ /**
+ * Deactivate the handler.
+ * @exception RemoteException if a remote exception occurs
+ */
+ void deactivate() throws RemoteException;
+}
+

Added:
trunk/main/metro/part/api/src/main/net/dpml/part/ProviderOperations.java
===================================================================
--- trunk/main/metro/part/api/src/main/net/dpml/part/ProviderOperations.java
2006-01-24 15:32:17 UTC (rev 968)
+++ trunk/main/metro/part/api/src/main/net/dpml/part/ProviderOperations.java
2006-01-24 15:48:40 UTC (rev 969)
@@ -0,0 +1,97 @@
+/*
+ * Copyright 2004 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.part;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+import java.lang.reflect.InvocationTargetException;
+
+import net.dpml.state.State;
+import net.dpml.state.StateListener;
+import net.dpml.state.UnknownOperationException;
+import net.dpml.state.UnknownTransitionException;
+
+/**
+ * ProviderOperations interface defines the set of operations
+ * common between local and remote provider consumers.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public interface ProviderOperations
+{
+ //-------------------------------------------------------------------
+ // implementation
+ //-------------------------------------------------------------------
+
+ /**
+ * Returns the current state of the control.
+ * @return the current runtime state
+ * @exception RemoteException if a remote I/O error occurs
+ */
+ State getState() throws RemoteException;
+
+ /**
+ * Add a state listener to the control.
+ * @param listener the state listener
+ * @exception RemoteException if a remote I/O error occurs
+ */
+ void addStateListener( StateListener listener ) throws RemoteException;
+
+ /**
+ * Remove a state listener from the control.
+ * @param listener the state listener
+ * @exception RemoteException if a remote I/O error occurs
+ */
+ void removeStateListener( StateListener listener ) throws
RemoteException;
+
+ /**
+ * Return the runtime value associated with this instance.
+ * @param isolate if TRUE the value returned is a proxy exposing the
+ * service interfaces declared by the component type otherwise
+ * the instance value is returned.
+ * @return the value
+ * @exception RemoteException if a remote I/O error occurs
+ */
+ Object getValue( boolean isolate ) throws RemoteException;
+
+ /**
+ * Apply a transition to the instance.
+ * @param key the transition name
+ * @return the state established as a result of applying the transition
+ * @exception UnknownTransitionException if the supplied key does not map
to an available transition
+ * @exception InvocationTargetException if an invocation error occurs
+ * @exception RemoteException if a remote I/O error occurs
+ */
+ State apply( String key )
+ throws UnknownTransitionException, InvocationTargetException,
RemoteException;
+
+ /**
+ * Invoke an operation on the instance.
+ * @param name the operation name
+ * @param args operation arguments
+ * @return the result of the operation invocation
+ * @exception UnknownOperationException if the supplied key does not map
to an available operation
+ * @exception InvocationTargetException if an invocation error occurs
+ * @exception RemoteException if a remote I/O error occurs
+ */
+ Object exec( String name, Object[] args )
+ throws UnknownOperationException, InvocationTargetException,
RemoteException;
+
+}

Copied:
trunk/main/metro/part/api/src/main/net/dpml/part/ServiceNotFoundException.java
(from rev 953,
trunk/main/metro/part/api/src/main/net/dpml/part/remote/ServiceNotFoundException.java)
===================================================================
---
trunk/main/metro/part/api/src/main/net/dpml/part/remote/ServiceNotFoundException.java
2006-01-23 04:08:06 UTC (rev 953)
+++
trunk/main/metro/part/api/src/main/net/dpml/part/ServiceNotFoundException.java
2006-01-24 15:48:40 UTC (rev 969)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2005 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.part;
+
+import java.net.URI;
+
+/**
+ * Exception thrown by a handler in response to a request for an unknown
service.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class ServiceNotFoundException extends ControlException
+{
+ /**
+ * Serial version identifier.
+ */
+ static final long serialVersionUID = 1L;
+
+ /**
+ * Creation of a new <tt>ServiceNotFoundException</tt>.
+ * @param uri the controller uri
+ * @param classname the service classname
+ */
+ public ServiceNotFoundException( URI uri, String classname )
+ {
+ super( uri, classname );
+ }
+}
+

Modified:
trunk/main/metro/part/api/src/main/net/dpml/part/remote/Component.java
===================================================================
--- trunk/main/metro/part/api/src/main/net/dpml/part/remote/Component.java
2006-01-24 15:32:17 UTC (rev 968)
+++ trunk/main/metro/part/api/src/main/net/dpml/part/remote/Component.java
2006-01-24 15:48:40 UTC (rev 969)
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005 Stephen J. McConnell
+ * Copyright (c) 2005-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.
@@ -23,6 +23,7 @@
import java.lang.reflect.InvocationTargetException;

import net.dpml.part.ControlException;
+import net.dpml.part.ComponentOperations;

/**
* The Component represents a remote interface to a runtime component type.
@@ -30,63 +31,7 @@
* @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
* @version @PROJECT-VERSION@
*/
-public interface Component extends Remote
+public interface Component extends Remote, ComponentOperations
{
- /**
- * Return a handler capable of supporting the requested service.
- * @param service the service descriptor
- * @return a component matching the requested service
- * @exception ServiceNotFoundException if no component could found
- * @exception RemoteException if a remote I/O occurs
- */
- Component lookup( Service service ) throws ServiceNotFoundException,
RemoteException;
-
- /**
- * Return true if this handler is a candidate for the supplied service
definition.
- * @param service the service descriptor
- * @return true if this is a candidate
- * @exception RemoteException if a remote exception occurs
- */
- boolean isaCandidate( Service service ) throws RemoteException;
-
- /**
- * Initiate activation of a runtime handler.
- * @exception ControlException if an activation error occurs
- * @exception InvocationTargetException if the component declares
activation on startup
- * and a implementation source exception occured
- * @exception RemoteException if a remote exception occurs
- */
- void activate() throws ControlException, InvocationTargetException,
RemoteException;
-
- /**
- * Returns the active status of the handler.
- * @return TRUE if the handler has been activated otherwise FALSE
- * @exception RemoteException if a remote exception occurs
- */
- boolean isActive() throws RemoteException;
-
- /**
- * Return the number of instances currently under management.
- * @return the instance count.
- * @exception RemoteException if a remote exception occurs
- */
- int size() throws RemoteException;
-
- /**
- * Return a reference to a instance of the component handled by the
handler.
- * @return the instance holder
- * @exception InvocationTargetException if the component instantiation
process
- * is on demand and an target invocation error occurs
- * @exception ControlException if the component could not be established
due to a controller
- * related error
- * @exception RemoteException if a remote exception occurs
- */
- Provider getProvider() throws ControlException,
InvocationTargetException, RemoteException;
-
- /**
- * Deactivate the handler.
- * @exception RemoteException if a remote exception occurs
- */
- void deactivate() throws RemoteException;
}


Modified:
trunk/main/metro/part/api/src/main/net/dpml/part/remote/Provider.java
===================================================================
--- trunk/main/metro/part/api/src/main/net/dpml/part/remote/Provider.java
2006-01-24 15:32:17 UTC (rev 968)
+++ trunk/main/metro/part/api/src/main/net/dpml/part/remote/Provider.java
2006-01-24 15:48:40 UTC (rev 969)
@@ -1,5 +1,5 @@
/*
- * Copyright 2004 Stephen J. McConnell.
+ * Copyright 2004-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.
@@ -27,70 +27,14 @@
import net.dpml.state.UnknownOperationException;
import net.dpml.state.UnknownTransitionException;

+import net.dpml.part.ProviderOperations;
+
/**
* Provider holder.
*
* @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
* @version @PROJECT-VERSION@
*/
-public interface Provider extends Remote
+public interface Provider extends Remote, ProviderOperations
{
- //-------------------------------------------------------------------
- // implementation
- //-------------------------------------------------------------------
-
- /**
- * Returns the current state of the control.
- * @return the current runtime state
- * @exception RemoteException if a remote I/O error occurs
- */
- State getState() throws RemoteException;
-
- /**
- * Add a state listener to the control.
- * @param listener the state listener
- * @exception RemoteException if a remote I/O error occurs
- */
- void addStateListener( StateListener listener ) throws RemoteException;
-
- /**
- * Remove a state listener from the control.
- * @param listener the state listener
- * @exception RemoteException if a remote I/O error occurs
- */
- void removeStateListener( StateListener listener ) throws
RemoteException;
-
- /**
- * Return the runtime value associated with this instance.
- * @param isolate if TRUE the value returned is a proxy exposing the
- * service interfaces declared by the component type otherwise
- * the instance value is returned.
- * @return the value
- * @exception RemoteException if a remote I/O error occurs
- */
- Object getValue( boolean isolate ) throws RemoteException;
-
- /**
- * Apply a transition to the instance.
- * @param key the transition name
- * @return the state established as a result of applying the transition
- * @exception UnknownTransitionException if the supplied key does not map
to an available transition
- * @exception InvocationTargetException if an invocation error occurs
- * @exception RemoteException if a remote I/O error occurs
- */
- State apply( String key )
- throws UnknownTransitionException, InvocationTargetException,
RemoteException;
-
- /**
- * Invoke an operation on the instance.
- * @param name the operation name
- * @param args operation arguments
- * @return the result of the operation invocation
- * @exception UnknownOperationException if the supplied key does not map
to an available operation
- * @exception InvocationTargetException if an invocation error occurs
- * @exception RemoteException if a remote I/O error occurs
- */
- Object exec( String name, Object[] args )
- throws UnknownOperationException, InvocationTargetException,
RemoteException;
-
}

Deleted:
trunk/main/metro/part/api/src/main/net/dpml/part/remote/ServiceNotFoundException.java
===================================================================
---
trunk/main/metro/part/api/src/main/net/dpml/part/remote/ServiceNotFoundException.java
2006-01-24 15:32:17 UTC (rev 968)
+++
trunk/main/metro/part/api/src/main/net/dpml/part/remote/ServiceNotFoundException.java
2006-01-24 15:48:40 UTC (rev 969)
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2005 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.part.remote;
-
-import java.net.URI;
-
-import net.dpml.part.ControlException;
-
-/**
- * Exception thrown by a handler in response to a request for an unknown
service.
- *
- * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
- * @version @PROJECT-VERSION@
- */
-public class ServiceNotFoundException extends ControlException
-{
- /**
- * Serial version identifier.
- */
- static final long serialVersionUID = 1L;
-
- /**
- * Creation of a new <tt>ServiceNotFoundException</tt>.
- * @param uri the controller uri
- * @param classname the service classname
- */
- public ServiceNotFoundException( URI uri, String classname )
- {
- super( uri, classname );
- }
-}
-

Modified:
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/ComponentController.java
===================================================================
---
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/ComponentController.java
2006-01-24 15:32:17 UTC (rev 968)
+++
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/ComponentController.java
2006-01-24 15:48:40 UTC (rev 969)
@@ -51,7 +51,7 @@
import net.dpml.metro.control.PartsManager;
import net.dpml.part.remote.Component;
import net.dpml.part.remote.Model;
-import net.dpml.part.remote.ServiceNotFoundException;
+import net.dpml.part.ServiceNotFoundException;

import net.dpml.transit.Category;
import net.dpml.transit.Value;

Modified:
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/ComponentHandler.java
===================================================================
---
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/ComponentHandler.java
2006-01-24 15:32:17 UTC (rev 968)
+++
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/ComponentHandler.java
2006-01-24 15:48:40 UTC (rev 969)
@@ -41,6 +41,7 @@
import net.dpml.metro.info.Priority;
import net.dpml.metro.data.CategoryDirective;
import net.dpml.metro.model.ComponentModel;
+import net.dpml.metro.control.Handler;

import net.dpml.logging.Logger;

@@ -48,11 +49,10 @@
import net.dpml.part.Disposable;
import net.dpml.part.ControlException;
import net.dpml.part.Version;
-import net.dpml.metro.control.Handler;
+import net.dpml.part.ServiceNotFoundException;
import net.dpml.part.remote.Component;
import net.dpml.part.remote.Provider;
import net.dpml.part.remote.Service;
-import net.dpml.part.remote.ServiceNotFoundException;
import net.dpml.part.remote.ModelEvent;
import net.dpml.part.remote.ModelListener;





  • r969 - in trunk/main/metro: model/src/main/net/dpml/metro/control part/api/src/main/net/dpml/part part/api/src/main/net/dpml/part/remote runtime/src/main/net/dpml/metro/runtime, mcconnell at BerliOS, 01/24/2006

Archive powered by MHonArc 2.6.24.

Top of Page