diff options
| author | slewis | 2005-07-02 22:32:49 +0000 |
|---|---|---|
| committer | slewis | 2005-07-02 22:32:49 +0000 |
| commit | 7dcb1bf692db0f7e97426dc904b18456065a716d (patch) | |
| tree | fe7a7d51ecbccf0b25a7f51b1c8d3c0ff6a7c1fd | |
| parent | 33480c70918a59fb935800d27ad9c718bad0e3c2 (diff) | |
| download | org.eclipse.ecf-7dcb1bf692db0f7e97426dc904b18456065a716d.tar.gz org.eclipse.ecf-7dcb1bf692db0f7e97426dc904b18456065a716d.tar.xz org.eclipse.ecf-7dcb1bf692db0f7e97426dc904b18456065a716d.zip | |
Added IEventHandler interface. Added compile dependency on IAdaptable and IEventHandler in ISharedObject. Removed getAdapter(), handleEvent, handleEvents from ISharedObject (because they are now provided by IAdaptable and IEventHandler). Added dependency to IAdaptable to ISharedObjectContext and removed getAdapter method call in ISharedObjectContext.
3 files changed, 30 insertions, 45 deletions
diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ISharedObject.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ISharedObject.java index 946b988fb..02f36e198 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ISharedObject.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ISharedObject.java @@ -9,14 +9,15 @@ package org.eclipse.ecf.core; +import org.eclipse.core.runtime.IAdaptable; import org.eclipse.ecf.core.identity.ID; -import org.eclipse.ecf.core.util.Event; +import org.eclipse.ecf.core.util.IEventHandler; /** * Core interface for implementing components that exist within {@link ISharedObjectContainer} * */ -public interface ISharedObject { +public interface ISharedObject extends IAdaptable, IEventHandler { /** * Initialize this ISharedObject. The ISharedObjectContainer for this @@ -41,26 +42,6 @@ public interface ISharedObject { throws SharedObjectInitException; /** - * Handle Event passed to this ISharedObject. The ISharedObjectContainer - * will pass events to all SharedObjects via this method and the - * handleEvents method. - * - * @param event - * the Event for the ISharedObject to process - */ - public void handleEvent(Event event); - - /** - * Handle Events passed to this ISharedObject. The ISharedObjectContainer - * will pass events to all SharedObjects via this method and the - * handleEvents method. - * - * @param events - * the Events [] for the ISharedObject to process - */ - public void handleEvents(Event[] events); - - /** * Method called by the ISharedObjectContainer upon ISharedObject * destruction. Once this method is called, no more Events will be passed to * a ISharedObject until the init method is called again. @@ -70,15 +51,4 @@ public interface ISharedObject { */ public void dispose(ID containerID); - /** - * Provide access to an adapter object. This method guarantees that any - * non-null object instance provided is an instance of the class provided as - * the first parameter. - * - * @param clazz - * the Class of the adapter. The returned Object instance must - * implement the given clazz - * @return Object the adaptor object - */ - public Object getAdapter(Class clazz); }
\ No newline at end of file diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ISharedObjectContext.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ISharedObjectContext.java index 4c3676fdb..498bec330 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ISharedObjectContext.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ISharedObjectContext.java @@ -11,6 +11,7 @@ package org.eclipse.ecf.core; import java.io.IOException; +import org.eclipse.core.runtime.IAdaptable; import org.eclipse.ecf.core.identity.ID; import org.eclipse.ecf.core.security.IJoinContext; import org.eclipse.ecf.core.util.IQueueEnqueue; @@ -28,7 +29,7 @@ import org.eclipse.ecf.core.util.IQueueEnqueue; * @see ISharedObject#init * @see ISharedObjectConfig#getContext() */ -public interface ISharedObjectContext { +public interface ISharedObjectContext extends IAdaptable { /** * Get the local container instance's ID @@ -177,17 +178,6 @@ public interface ISharedObjectContext { public void sendMessage(ID toContainerID, Object data) throws IOException; /** - * Returns an object which is an instance of the given class associated with - * this object. - * - * @param clazz - * the adapter class to lookup - * @return Object a object castable to the given class, or null if this - * object does not have an adapter for the given class - */ - public Object getAdapter(Class clazz); - - /** * Get a reference to a proxy instance that allows the registration and * access to local OSGI-platform-provided services. If this method returns * null, then such services are not available. diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/IEventHandler.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/IEventHandler.java new file mode 100644 index 000000000..db50f8327 --- /dev/null +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/IEventHandler.java @@ -0,0 +1,25 @@ +package org.eclipse.ecf.core.util; + +public interface IEventHandler { + + /** + * Handle Event passed to this ISharedObject. The ISharedObjectContainer + * will pass events to all SharedObjects via this method and the + * handleEvents method. + * + * @param event + * the Event for the ISharedObject to process + */ + public void handleEvent(Event event); + + /** + * Handle Events passed to this ISharedObject. The ISharedObjectContainer + * will pass events to all SharedObjects via this method and the + * handleEvents method. + * + * @param events + * the Events [] for the ISharedObject to process + */ + public void handleEvents(Event[] events); + +} |
