diff options
Diffstat (limited to 'framework')
70 files changed, 39 insertions, 4089 deletions
diff --git a/framework/bundles/org.eclipse.ecf.datashare/META-INF/MANIFEST.MF b/framework/bundles/org.eclipse.ecf.datashare/META-INF/MANIFEST.MF index 8d3615d89..c4faf3583 100644 --- a/framework/bundles/org.eclipse.ecf.datashare/META-INF/MANIFEST.MF +++ b/framework/bundles/org.eclipse.ecf.datashare/META-INF/MANIFEST.MF @@ -8,7 +8,8 @@ Bundle-Vendor: Eclipse.org Bundle-Localization: plugin Eclipse-AutoStart: true Require-Bundle: org.eclipse.ecf;visibility:=reexport, - org.eclipse.core.runtime + org.eclipse.core.runtime, + org.eclipse.ecf.sharedobject Export-Package: org.eclipse.ecf.datashare, org.eclipse.ecf.datashare.events, org.eclipse.ecf.datashare.mergeable diff --git a/framework/bundles/org.eclipse.ecf.identity/plugin.xml b/framework/bundles/org.eclipse.ecf.identity/plugin.xml index 49a52ac4d..2853f1b17 100644 --- a/framework/bundles/org.eclipse.ecf.identity/plugin.xml +++ b/framework/bundles/org.eclipse.ecf.identity/plugin.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <?eclipse version="3.2"?> <plugin> - <extension-point id="namespace" name="namespace" schema="schema/namespace.exsd"/> + <extension-point id="namespace" name="ECF Namespace Extension Point" schema="schema/namespace.exsd"/> </plugin> diff --git a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/Activator.java b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/Activator.java index 0e66c9f64..e22839a26 100644 --- a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/Activator.java +++ b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/Activator.java @@ -224,6 +224,8 @@ public class Activator extends Plugin { public void stop(BundleContext context) throws Exception { Trace.entering(Activator.getDefault(), IdentityDebugOptions.METHODS_EXITING, Activator.class, "stop"); + Platform.getExtensionRegistry().removeRegistryChangeListener(registryManager); + registryManager = null; plugin = null; super.stop(context); } diff --git a/framework/bundles/org.eclipse.ecf.presence/src/org/eclipse/ecf/presence/ISharedObjectMessageListener.java b/framework/bundles/org.eclipse.ecf.presence/src/org/eclipse/ecf/presence/ISharedObjectMessageListener.java deleted file mode 100644 index e2528fab5..000000000 --- a/framework/bundles/org.eclipse.ecf.presence/src/org/eclipse/ecf/presence/ISharedObjectMessageListener.java +++ /dev/null @@ -1,28 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2004 Composent, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Composent, Inc. - initial API and implementation - *****************************************************************************/ -package org.eclipse.ecf.presence; - -import org.eclipse.ecf.core.sharedobject.events.ISharedObjectMessageEvent; - -/** - * Listener for receiving shared object messages - * - */ -public interface ISharedObjectMessageListener { - /** - * Receive shared object message via shared object message event. - * - * @param event - * the shared object message event holding the shared object - * message - */ - public void handleSharedObjectMessage(ISharedObjectMessageEvent event); -} diff --git a/framework/bundles/org.eclipse.ecf.provider/META-INF/MANIFEST.MF b/framework/bundles/org.eclipse.ecf.provider/META-INF/MANIFEST.MF index b56c465ae..c56e6455c 100644 --- a/framework/bundles/org.eclipse.ecf.provider/META-INF/MANIFEST.MF +++ b/framework/bundles/org.eclipse.ecf.provider/META-INF/MANIFEST.MF @@ -9,7 +9,8 @@ Bundle-Localization: plugin Eclipse-LazyStart: true Eclipse-AutoStart: true Require-Bundle: org.eclipse.core.runtime, - org.eclipse.ecf + org.eclipse.ecf, + org.eclipse.ecf.sharedobject;visibility:=reexport Provide-Package: org.eclipse.ecf.provider.comm.tcp, org.eclipse.ecf.provider.app, org.eclipse.ecf.provider.generic, org.eclipse.ecf.provider.generic.gmm Export-Package: org.eclipse.ecf.provider.comm.tcp, org.eclipse.ecf.provider.app, org.eclipse.ecf.provider.generic, org.eclipse.ecf.provider.generic.gmm Eclipse-BuddyPolicy: global diff --git a/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/app/ServerApplication.java b/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/app/ServerApplication.java index 2c66f9846..7c02f94c5 100644 --- a/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/app/ServerApplication.java +++ b/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/app/ServerApplication.java @@ -17,7 +17,7 @@ import org.eclipse.ecf.core.identity.ID; import org.eclipse.ecf.core.identity.IDFactory; import org.eclipse.ecf.core.identity.IDCreateException; import org.eclipse.ecf.core.security.IConnectPolicy; -import org.eclipse.ecf.core.security.ISharedObjectPolicy; +import org.eclipse.ecf.core.sharedobject.security.ISharedObjectPolicy; import org.eclipse.ecf.core.sharedobject.ISharedObjectContainerGroupManager; import org.eclipse.ecf.core.sharedobject.ISharedObjectManager; import org.eclipse.ecf.core.sharedobject.ReplicaSharedObjectDescription; diff --git a/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/SOContainer.java b/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/SOContainer.java index 8ade14b75..4a92b8b3d 100644 --- a/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/SOContainer.java +++ b/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/SOContainer.java @@ -42,7 +42,7 @@ import org.eclipse.ecf.core.identity.ID; import org.eclipse.ecf.core.identity.IDFactory; import org.eclipse.ecf.core.identity.Namespace; import org.eclipse.ecf.core.security.IConnectContext; -import org.eclipse.ecf.core.security.ISharedObjectPolicy; +import org.eclipse.ecf.core.sharedobject.security.ISharedObjectPolicy; import org.eclipse.ecf.core.sharedobject.ISharedObject; import org.eclipse.ecf.core.sharedobject.ISharedObjectConfig; import org.eclipse.ecf.core.sharedobject.ISharedObjectContainer; diff --git a/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/SOManager.java b/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/SOManager.java index f9cf886fb..237e8da59 100644 --- a/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/SOManager.java +++ b/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/SOManager.java @@ -26,7 +26,7 @@ import java.util.Vector; import org.eclipse.ecf.core.identity.ID; import org.eclipse.ecf.core.identity.IDFactory; import org.eclipse.ecf.core.identity.IDCreateException; -import org.eclipse.ecf.core.security.ISharedObjectPolicy; +import org.eclipse.ecf.core.sharedobject.security.ISharedObjectPolicy; import org.eclipse.ecf.core.sharedobject.ISharedObject; import org.eclipse.ecf.core.sharedobject.ISharedObjectConnector; import org.eclipse.ecf.core.sharedobject.ISharedObjectManager; diff --git a/framework/bundles/org.eclipse.ecf.ui/META-INF/MANIFEST.MF b/framework/bundles/org.eclipse.ecf.ui/META-INF/MANIFEST.MF index 98c0609da..fa5d259bf 100644 --- a/framework/bundles/org.eclipse.ecf.ui/META-INF/MANIFEST.MF +++ b/framework/bundles/org.eclipse.ecf.ui/META-INF/MANIFEST.MF @@ -12,7 +12,8 @@ Require-Bundle: org.eclipse.ecf, org.eclipse.core.runtime, org.eclipse.ecf.presence, org.eclipse.ecf.discovery, - org.eclipse.core.resources + org.eclipse.core.resources, + org.eclipse.ecf.sharedobject Eclipse-AutoStart: true Provide-Package: org.eclipse.ecf.ui, org.eclipse.ecf.ui.dialogs, diff --git a/framework/bundles/org.eclipse.ecf/META-INF/MANIFEST.MF b/framework/bundles/org.eclipse.ecf/META-INF/MANIFEST.MF index 5348ebd27..1ce270440 100644 --- a/framework/bundles/org.eclipse.ecf/META-INF/MANIFEST.MF +++ b/framework/bundles/org.eclipse.ecf/META-INF/MANIFEST.MF @@ -19,9 +19,6 @@ Export-Package: org.eclipse.ecf.core, org.eclipse.ecf.core.events, org.eclipse.ecf.core.provider, org.eclipse.ecf.core.security, - org.eclipse.ecf.core.sharedobject, - org.eclipse.ecf.core.sharedobject.events, - org.eclipse.ecf.core.sharedobject.provider, org.eclipse.ecf.core.start, org.eclipse.ecf.core.user, org.eclipse.ecf.core.util diff --git a/framework/bundles/org.eclipse.ecf/javadoc.xml b/framework/bundles/org.eclipse.ecf/javadoc.xml index 0cd77607f..84fa398e3 100644 --- a/framework/bundles/org.eclipse.ecf/javadoc.xml +++ b/framework/bundles/org.eclipse.ecf/javadoc.xml @@ -1,6 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> <project default="javadoc"> -<target name="javadoc"> -<javadoc access="protected" additionalparam="-J-Xmx256m " author="false" classpath="../org.jivesoftware.smack.jingle/lib/jspeex.jar;../org.eclipse.ecf.call/bin;C:\eclipse3.3m2\eclipse\plugins\org.eclipse.jface_3.3.0.I20060921-0010.jar;../org.eclipse.ecf.provider/bin;C:\eclipse3.3m2\eclipse\plugins\org.eclipse.swt_3.3.0.v3309a.jar;../org.eclipse.ecf.provider.jmdns/lib/jmdns-1.0.3.jar;C:\eclipse3.3m2\eclipse\plugins\org.eclipse.jface.text_3.3.0.v20060920-1200.jar;../org.eclipse.ecf.datashare/bin;C:\eclipse3.3m2\eclipse\plugins\org.eclipse.equinox.common_3.3.0.v20060906.jar;C:\eclipse3.3m2\eclipse\plugins\org.eclipse.core.contenttype_3.2.100.v20060808.jar;C:\eclipse3.3m2\eclipse\plugins\org.eclipse.core.commands_3.2.0.I20060918-0010.jar;C:\eclipse3.3m2\eclipse\plugins\org.eclipse.core.jobs_3.2.0.v20060731.jar;../org.eclipse.ecf.provider.irc/lib/irclib.jar;C:\eclipse3.3m2\eclipse\plugins\org.eclipse.equinox.registry_3.2.100.v20060918.jar;../org.eclipse.ecf.presence/bin;../org.eclipse.ecf.discovery/bin;C:\eclipse3.3m2\eclipse\plugins\org.eclipse.core.runtime_3.2.100.v20060905.jar;../org.jivesoftware.smack/bin;../org.jivesoftware.smack.jingle/bin;bin;C:\eclipse3.3m2\eclipse\plugins\org.eclipse.text_3.3.0.v20060920-1200.jar;C:\eclipse3.3m2\eclipse\plugins\org.eclipse.core.resources_3.2.100.v20060821.jar;C:\eclipse3.3m2\eclipse\plugins\org.eclipse.ui.workbench_3.3.0.I20060921-0010.jar;../org.jivesoftware.smack.jingle/lib/jmf.jar;C:\eclipse3.3m2\eclipse\plugins\org.eclipse.osgi_3.3.0.v20060919.jar;../org.eclipse.ecf.fileshare/bin;C:\eclipse3.3m2\eclipse\plugins\org.eclipse.ui_3.3.0.I20060921-0010.jar;../org.jivesoftware.smack/jars/xmlpull.v1.jar;../org.eclipse.ecf.core.identity/bin;../org.jivesoftware.smack.jingle/lib/jstun-0.6.1.jar;C:\eclipse3.3m2\eclipse\plugins\org.eclipse.equinox.preferences_3.2.100.v20060918.jar;../org.eclipse.ecf.remoteservice/bin;C:\eclipse3.3m2\eclipse\plugins\org.eclipse.swt.win32.win32.x86_3.3.0.v3309.jar;C:\eclipse3.3m2\eclipse\plugins\org.eclipse.core.runtime.compatibility.registry_3.2.100.v20060828\runtime_registry_compatibility.jar" destdir="../ecf documentation/org.eclipse.ecf.docs/api" doctitle="Eclipse Communication Framework (ECF) 0.9.3" nodeprecated="false" nodeprecatedlist="false" noindex="false" nonavbar="false" notree="false" packagenames="org.eclipse.ecf.fileshare,org.eclipse.ecf.provider.xmpp,org.eclipse.ecf.presence,org.eclipse.ecf.provider.jmdns.container,org.eclipse.ecf.ui.views,org.eclipse.ecf.provider.generic.gmm,org.eclipse.ecf.provider.app,org.eclipse.ecf.discovery.identity,org.eclipse.ecf.provider.xmpp.smack.test,org.eclipse.ecf.remoteservice,org.eclipse.ecf.presence.impl,org.eclipse.ecf.provider.irc.identity,org.eclipse.ecf.filetransfer,org.eclipse.ecf.core.user,org.eclipse.ecf.provider.remoteservice,org.eclipse.ecf.server,org.eclipse.ecf.provider.irc.container,org.eclipse.ecf.provider.xmpp.smack,org.eclipse.ecf.core.sharedobject,org.eclipse.ecf.core.util,org.eclipse.ecf.provider.xmpp.container,org.eclipse.ecf.core.events,org.eclipse.ecf.datashare,org.eclipse.ecf.core.comm.provider,org.eclipse.ecf.datashare.events,org.eclipse.ecf.core.security,org.eclipse.ecf.core.comm,org.eclipse.ecf.ui.wizards,org.eclipse.ecf.discovery,org.eclipse.ecf.provider.jmdns,org.eclipse.ecf.core.start,org.eclipse.ecf.presence.provider,org.eclipse.ecf.call.events,org.eclipse.ecf.provider.fileshare,org.eclipse.ecf.provider.comm.tcp,org.eclipse.ecf.provider.generic,org.eclipse.ecf.remoteservice.events,org.eclipse.ecf.filetransfer.events,org.eclipse.ecf.provider.xmpp.events,org.eclipse.ecf.presence.chat,org.eclipse.ecf.fileshare.events,org.eclipse.ecf.datashare.mergeable,org.eclipse.ecf.call,org.eclipse.ecf.ui.util,org.eclipse.ecf.core.identity,org.eclipse.ecf.ui,org.eclipse.ecf.ui.dialogs,org.eclipse.ecf.provider.jmdns.identity,org.eclipse.ecf.provider.datashare,org.eclipse.ecf.provider.remoteservice.generic,org.eclipse.ecf.core.provider,org.eclipse.ecf.provider.xmpp.identity,org.eclipse.ecf.provider.irc" source="1.4" sourcefiles="src/org/eclipse/ecf/core/ISharedObjectContainerConfig.java,src/org/eclipse/ecf/core/ISharedObjectContainerTransaction.java,src/org/eclipse/ecf/core/ContainerAuthenticationException.java,src/org/eclipse/ecf/core/SharedObjectConnectException.java,../org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/ProviderPlugin.java,src/org/eclipse/ecf/core/IContainerFactory.java,src/org/eclipse/ecf/core/SharedObjectInitException.java,src/org/eclipse/ecf/core/SharedObjectCreateException.java,src/org/eclipse/ecf/core/SharedObjectContainerFactory.java,src/org/eclipse/ecf/core/ReplicaSharedObjectDescription.java,src/org/eclipse/ecf/core/ContainerTypeDescription.java,src/org/eclipse/ecf/core/IOSGIService.java,src/org/eclipse/ecf/core/ISharedObjectConfig.java,src/org/eclipse/ecf/core/IReplicaSharedObjectDescriptionFactory.java,src/org/eclipse/ecf/core/SharedObjectAddException.java,src/org/eclipse/ecf/core/ContainerFactory.java,src/org/eclipse/ecf/core/ISharedObjectTransactionParticipantsFilter.java,src/org/eclipse/ecf/core/IReliableContainer.java,src/org/eclipse/ecf/core/SharedObjectAddAbortException.java,src/org/eclipse/ecf/core/IIdentifiable.java,src/org/eclipse/ecf/core/ISharedObjectManager.java,../org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/Trace.java,src/org/eclipse/ecf/core/ContainerCreateException.java,src/org/eclipse/ecf/core/SharedObjectDescription.java,src/org/eclipse/ecf/core/SharedObjectContainerInitException.java,src/org/eclipse/ecf/core/AbstractContainer.java,src/org/eclipse/ecf/core/ISharedObjectContainerFactory.java,src/org/eclipse/ecf/core/SharedObjectNotFoundException.java,src/org/eclipse/ecf/core/ISharedObjectConnector.java,src/org/eclipse/ecf/core/ISharedObject.java,src/org/eclipse/ecf/core/ISharedObjectContext.java,src/org/eclipse/ecf/core/ISharedObjectFactory.java,src/org/eclipse/ecf/core/AbstractSharedObjectContainerAdapterFactory.java,src/org/eclipse/ecf/core/SharedObjectTypeDescription.java,src/org/eclipse/ecf/core/ISharedObjectContainer.java,src/org/eclipse/ecf/core/ISharedObjectContainerGroupManager.java,src/org/eclipse/ecf/core/IContainer.java,src/org/eclipse/ecf/core/ISharedObjectTransactionConfig.java,src/org/eclipse/ecf/core/IContainerListener.java,src/org/eclipse/ecf/core/ContainerConnectException.java,src/org/eclipse/ecf/core/SharedObjectFactory.java,src/org/eclipse/ecf/core/SharedObjectDisconnectException.java" sourcepath="../org.eclipse.ecf.provider.fileshare/src;../org.eclipse.ecf.provider.xmpp/src;../org.eclipse.ecf.server/src;../org.eclipse.ecf.provider.irc/src;../org.eclipse.ecf.core.identity/src;../org.eclipse.ecf.provider.datashare/src;../org.eclipse.ecf.provider/src;../org.eclipse.ecf.presence/src;src;../org.eclipse.ecf.provider.jmdns/src;../org.eclipse.ecf.provider.remoteservice/src;../org.eclipse.ecf.ui/src;../org.eclipse.ecf.discovery/src;../org.eclipse.ecf.remoteservice/src;../org.eclipse.ecf.call/src;../org.eclipse.ecf.datashare/src;../org.eclipse.ecf.fileshare/src" splitindex="true" use="true" version="true"/> -</target> + <target name="javadoc"> + <javadoc access="protected" + additionalparam="-J-Xmx256m " + author="false" + classpath="C:\eclipse3.2\eclipse\plugins\org.eclipse.ui.workbench_3.2.0.I20060605-1400.jar;../org.eclipse.ecf.core.sharedobject/bin;C:\eclipse3.2\eclipse\plugins\org.eclipse.core.jobs_3.2.0.v20060603.jar;../org.eclipse.ecf.provider/bin;C:\eclipse3.2\eclipse\plugins\org.eclipse.core.runtime.compatibility.registry_3.2.0.v20060603\runtime_registry_compatibility.jar;C:\eclipse3.2\eclipse\plugins\org.eclipse.ui_3.2.0.I20060605-1400.jar;C:\eclipse3.2\eclipse\plugins\org.eclipse.jface_3.2.0.I20060605-1400.jar;C:\eclipse3.2\eclipse\plugins\org.eclipse.text_3.2.0.v20060605-1400.jar;C:\eclipse3.2\eclipse\plugins\org.eclipse.jface.text_3.2.0.v20060605-1400.jar;C:\eclipse3.2\eclipse\plugins\org.eclipse.core.resources_3.2.0.v20060603.jar;C:\eclipse3.2\eclipse\plugins\org.eclipse.swt_3.2.0.v3232o.jar;C:\eclipse3.2\eclipse\plugins\org.eclipse.osgi_3.2.0.v20060601.jar;C:\eclipse3.2\eclipse\plugins\org.eclipse.equinox.common_3.2.0.v20060603.jar;../org.eclipse.ecf.datashare/bin;../org.eclipse.ecf.presence/bin;../org.eclipse.ecf.discovery/bin;bin;C:\eclipse3.2\eclipse\plugins\org.eclipse.core.commands_3.2.0.I20060605-1400.jar;C:\eclipse3.2\eclipse\plugins\org.eclipse.equinox.registry_3.2.0.v20060601.jar;C:\eclipse3.2\eclipse\plugins\org.eclipse.swt.win32.win32.x86_3.2.0.v3232m.jar;../org.eclipse.ecf.fileshare/bin;C:\eclipse3.2\eclipse\plugins\org.eclipse.core.contenttype_3.2.0.v20060603.jar;C:\eclipse3.2\eclipse\plugins\org.eclipse.equinox.preferences_3.2.0.v20060601.jar;C:\eclipse3.2\eclipse\plugins\org.eclipse.core.runtime_3.2.0.v20060603.jar;../org.eclipse.ecf.core.identity/bin;../org.eclipse.ecf.remoteservice/bin" + destdir="../ecf documentation/org.eclipse.ecf.docs/api" + doctitle="Eclipse Communication Framework (ECF) 0.9.3" + nodeprecated="false" + nodeprecatedlist="false" + noindex="false" + nonavbar="false" + notree="false" + packagenames="org.eclipse.ecf.core.sharedobject,org.eclipse.ecf.core.sharedobject.events,org.eclipse.ecf.fileshare,org.eclipse.ecf.core.sharedobject.provider,org.eclipse.ecf.presence,org.eclipse.ecf.ui.views,org.eclipse.ecf.provider.generic.gmm,org.eclipse.ecf.provider.app,org.eclipse.ecf.discovery.identity,org.eclipse.ecf.remoteservice,org.eclipse.ecf.presence.impl,org.eclipse.ecf.provider.filetransfer,org.eclipse.ecf.filetransfer,org.eclipse.ecf.core.user,org.eclipse.ecf.core.sharedobject.security,org.eclipse.ecf.provider.remoteservice,org.eclipse.ecf.server,org.eclipse.ecf.core.events,org.eclipse.ecf.core.util,org.eclipse.ecf.datashare,org.eclipse.ecf.core.comm.provider,org.eclipse.ecf.datashare.events,org.eclipse.ecf.core.comm,org.eclipse.ecf.core.security,org.eclipse.ecf.ui.wizards,org.eclipse.ecf.discovery,org.eclipse.ecf.core.start,org.eclipse.ecf.presence.provider,org.eclipse.ecf.call.events,org.eclipse.ecf.provider.fileshare,org.eclipse.ecf.provider.comm.tcp,org.eclipse.ecf.remoteservice.events,org.eclipse.ecf.provider.generic,org.eclipse.ecf.filetransfer.events,org.eclipse.ecf.presence.chat,org.eclipse.ecf.fileshare.events,org.eclipse.ecf.call,org.eclipse.ecf.ui.util,org.eclipse.ecf.datashare.mergeable,org.eclipse.ecf.core.identity,org.eclipse.ecf.ui.dialogs,org.eclipse.ecf.ui,org.eclipse.ecf.provider.datashare,org.eclipse.ecf.provider.remoteservice.generic,org.eclipse.ecf.core.provider" + source="1.4" + sourcefiles="src/org/eclipse/ecf/core/ContainerAuthenticationException.java,src/org/eclipse/ecf/core/IContainerFactory.java,src/org/eclipse/ecf/core/ContainerTypeDescription.java,src/org/eclipse/ecf/core/IOSGIService.java,src/org/eclipse/ecf/core/ContainerFactory.java,src/org/eclipse/ecf/core/IReliableContainer.java,src/org/eclipse/ecf/core/IIdentifiable.java,src/org/eclipse/ecf/core/ContainerCreateException.java,src/org/eclipse/ecf/core/AbstractContainer.java,src/org/eclipse/ecf/core/IContainer.java,src/org/eclipse/ecf/core/IContainerListener.java,src/org/eclipse/ecf/core/ContainerConnectException.java" + sourcepath="../org.eclipse.ecf.filetransfer/src;../org.eclipse.ecf.provider.fileshare/src;../org.eclipse.ecf.server/src;../org.eclipse.ecf.core.identity/src;../org.eclipse.ecf.provider.datashare/src;../org.eclipse.ecf.provider/src;../org.eclipse.ecf.core.sharedobject/src;../org.eclipse.ecf.presence/src;src;../org.eclipse.ecf.provider.remoteservice/src;../org.eclipse.ecf.ui/src;../org.eclipse.ecf.discovery/src;../org.eclipse.ecf.remoteservice/src;../org.eclipse.ecf.call/src;../org.eclipse.ecf.datashare/src;../org.eclipse.ecf.fileshare/src" + splitindex="true" + use="true" + version="true" /> + </target> </project> diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/IContainerListener.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/IContainerListener.java index 5a1a47ce1..af24d864d 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/IContainerListener.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/IContainerListener.java @@ -9,13 +9,12 @@ package org.eclipse.ecf.core; import org.eclipse.ecf.core.events.IContainerEvent; -import org.eclipse.ecf.core.sharedobject.ISharedObjectContainer; /** * Listener for objects that wish to receive events from an - * ISharedObjectContainer instance. + * IContainer instances. * - * @see ISharedObjectContainer#addListener(IContainerListener, + * @see IContainer#addListener(IContainerListener, * String) */ public interface IContainerListener { diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/ISharedObjectPolicy.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/ISharedObjectPolicy.java deleted file mode 100644 index de270d50c..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/ISharedObjectPolicy.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.security; - -import java.security.PermissionCollection; -import org.eclipse.ecf.core.identity.ID; -import org.eclipse.ecf.core.sharedobject.ReplicaSharedObjectDescription; - -public interface ISharedObjectPolicy extends IContainerPolicy { - /** - * Check the request to add a shared object from external source (i.e. - * remote container). - * - * @param fromID - * the ID of the container making the container add request - * @param toID - * the ID of the container receiving/handling the add request. - * Null if directed to all containers in group. - * @param localID - * the ID of the local container - * @param newObjectDescription - * the ReplicaSharedObjectDescription associated with the shared - * object being added - * @return PermissionCollection the permission collection associated with - * successful acceptance of the add request. Null if the add should - * be refused, Non-null if add request is accepted. - * @throws SecurityException - * if request should be refused <b>and</b> associated container - * should leave group - */ - public PermissionCollection checkAddSharedObject(ID fromID, ID toID, - ID localID, ReplicaSharedObjectDescription newObjectDescription) - throws SecurityException; -} diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/AbstractSharedObject.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/AbstractSharedObject.java deleted file mode 100644 index 1ebcde859..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/AbstractSharedObject.java +++ /dev/null @@ -1,390 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2004 Composent, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Composent, Inc. - initial API and implementation - *****************************************************************************/ -package org.eclipse.ecf.core.sharedobject; - -import java.io.IOException; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Vector; - -import org.eclipse.ecf.core.IIdentifiable; -import org.eclipse.ecf.core.identity.ID; -import org.eclipse.ecf.core.sharedobject.events.ISharedObjectCreateResponseEvent; -import org.eclipse.ecf.core.sharedobject.events.ISharedObjectMessageEvent; -import org.eclipse.ecf.core.sharedobject.events.RemoteSharedObjectEvent; -import org.eclipse.ecf.core.util.Event; -import org.eclipse.ecf.core.util.IEventProcessor; -import org.eclipse.ecf.core.util.IQueueEnqueue; -import org.eclipse.ecf.core.util.QueueException; -import org.eclipse.ecf.core.util.Trace; -import org.eclipse.ecf.internal.core.ECFDebugOptions; -import org.eclipse.ecf.internal.core.ECFPlugin; - -/** - * Base class for shared object classes. - * - */ -public class AbstractSharedObject implements ISharedObject, - IIdentifiable { - - private ISharedObjectConfig config = null; - private List eventProcessors = new Vector(); - - public AbstractSharedObject() { - super(); - } - public final void init(ISharedObjectConfig initData) - throws SharedObjectInitException { - this.config = initData; - trace("init("+initData+")"); - addEventProcessor(new SharedObjectMsgEventProcessor(this)); - initialize(); - } - /** - * Initialize this shared object. Subclasses may override as appropriate - * to define custom initialization behavior. If initialization should - * fail, then a SharedObjectInitException should be thrown by implementing code. - * Also, subclasses overriding this method should call super.initialize() before - * running their own code. - * - * @throws SharedObjectInitException if initialization should throw - */ - protected void initialize() throws SharedObjectInitException {} - /** - * Called by replication strategy code (e.g. two phase commit) when creation is completed (i.e. when transactional - * replication completed successfully). Subclasses that need to be notified when creation is completed should - * override this method. - * - */ - protected void creationCompleted() { - trace("creationCompleted()"); - } - public void dispose(ID containerID) { - trace("dispose("+containerID+")"); - eventProcessors.clear(); - config = null; - } - public Object getAdapter(Class adapter) { - return null; - } - public void handleEvent(Event event) { - trace("handleEvent("+event+")"); - synchronized (eventProcessors) { - fireEventProcessors(event); - } - } - protected boolean addEventProcessor(IEventProcessor proc) { - return eventProcessors.add(proc); - } - protected boolean removeEventProcessor(IEventProcessor proc) { - return eventProcessors.remove(proc); - } - protected void clearEventProcessors() { - eventProcessors.clear(); - } - protected void handleUnhandledEvent(Event event) { - trace("handleUnhandledEvent("+event+")"); - } - protected void fireEventProcessors(Event event) { - if (event == null) return; - Event evt = event; - if (eventProcessors.size()==0) { - handleUnhandledEvent(event); - return; - } - for(Iterator i=eventProcessors.iterator(); i.hasNext(); ) { - IEventProcessor ep = (IEventProcessor) i.next(); - trace("calling eventProcessor="+ep+" for event="+evt); - if (ep.processEvent(evt)) break; - } - } - public void handleEvents(Event[] events) { - trace("handleEvents("+Arrays.asList(events)+")"); - if (events == null) return; - for(int i=0; i < events.length; i++) { - handleEvent(events[i]); - } - } - public ID getID() { - return getConfig().getSharedObjectID(); - } - protected ISharedObjectConfig getConfig() { - return config; - } - protected ISharedObjectContext getContext() { - return getConfig().getContext(); - } - protected ID getHomeContainerID() { - return getConfig().getHomeContainerID(); - } - protected ID getLocalContainerID() { - return getContext().getLocalContainerID(); - } - protected ID getGroupID() { - return getContext().getConnectedID(); - } - protected boolean isConnected() { - return (getContext().getConnectedID() != null); - } - protected boolean isPrimary() { - ID local = getLocalContainerID(); - ID home = getHomeContainerID(); - if (local == null || home == null) { - return false; - } else return (local.equals(home)); - } - protected Map getProperties() { - return getConfig().getProperties(); - } - protected void destroySelf() { - trace("destroySelf()"); - if (isPrimary()) { - try { - // Send destroy message to all known remotes - destroyRemote(null); - } catch (IOException e) { - traceStack("Exception sending destroy message to remotes", e); - } - } - destroySelfLocal(); - } - protected void destroySelfLocal() { - trace("destroySelfLocal()"); - try { - ISharedObjectManager manager = getContext().getSharedObjectManager(); - if (manager != null) { - manager.removeSharedObject(getID()); - } - } catch (Exception e) { - traceStack("Exception in destroySelfLocal()",e); - } - } - protected void destroyRemote(ID remoteID) throws IOException { - trace("destroyRemote("+remoteID+")"); - getContext().sendDispose(remoteID); - } - private void trace(String msg) { - Trace.trace(ECFPlugin.getDefault(),getID()+":"+msg); - } - private void traceStack(String msg, Throwable t) { - Trace.catching(ECFPlugin.getDefault(), ECFDebugOptions.EXCEPTIONS_CATCHING, AbstractSharedObject.class, "traceStack", t); - } - /** - * Send SharedObjectMessage to container with given ID. The toID - * parameter may be null, and if null the message will be delivered to - * <b>all</b> containers in group. The second parameter may not be null. - * - * @param toID the target container ID for the SharedObjectMsg. If null, the - * given message is sent to all other containers currently in group - * @param msg the message instance to send - * @throws IOException thrown if the local container is not connected or unable - * to send for other reason - */ - protected void sendSharedObjectMsgTo(ID toID, SharedObjectMsg msg) - throws IOException { - if (msg == null) throw new NullPointerException("msg cannot be null"); - getContext().sendMessage(toID, - new SharedObjectMsgEvent(getID(), toID, msg)); - } - /** - * Send SharedObjectMsg to this shared object's primary instance. - * @param msg the message instance to send - * @throws IOException throws if the local container is not connect or unable - * to send for other reason - */ - protected void sendSharedObjectMsgToPrimary(SharedObjectMsg msg) throws IOException { - sendSharedObjectMsgTo(getHomeContainerID(), msg); - } - /** - * Send SharedObjectMsg to local shared object. This places the given message at - * the end of this shared object's message queue for processing. - * @param msg the message instance to send. - */ - protected void sendSharedObjectMsgToSelf(SharedObjectMsg msg) { - if (msg == null) throw new NullPointerException("msg cannot be null"); - ISharedObjectContext context = getContext(); - if (context == null) - return; - IQueueEnqueue queue = context.getQueue(); - try { - queue.enqueue(new SharedObjectMsgEvent(getID(), getContext() - .getLocalContainerID(), msg)); - } catch (QueueException e) { - traceStack("QueueException enqueing message to self", e); - return; - } - } - /** - * Get SharedObjectMsg from ISharedObjectMessageEvent. ISharedObjectMessageEvents - * can come from both local and remote sources. In the remote case, the SharedObjectMsg - * has to be retrieved from the RemoteSharedObjectEvent rather than the - * ISharedObjectMessageEvent.getData() directly. This method will provide a non-null - * SharedObjectMsg if it's provided either via remotely or locally. Returns null - * if the given event does not provide a valid SharedObjectMsg. - * @param event - * @return SharedObjectMsg the SharedObjectMsg delivered by the given event - */ - protected SharedObjectMsg getSharedObjectMsgFromEvent( - ISharedObjectMessageEvent event) { - Object eventData = event.getData(); - Object msgData = null; - // If eventData is not null and instanceof RemoteSharedObjectEvent - // then its a remote event and we extract the SharedObjectMsgEvent it - // contains and get it's data - if (eventData != null && eventData instanceof RemoteSharedObjectEvent) { - // It's a remote event - Object rsoeData = ((RemoteSharedObjectEvent) event).getData(); - if (rsoeData != null && rsoeData instanceof SharedObjectMsgEvent) - msgData = ((SharedObjectMsgEvent) rsoeData).getData(); - } else - msgData = eventData; - if (msgData != null && msgData instanceof SharedObjectMsg) - return (SharedObjectMsg) msgData; - return null; - } - /** - * Handle a ISharedObjectMessageEvent. This method will be automatically called by - * the SharedObjectMsgEventProcessor when a ISharedObjectMessageEvent is received. - * The SharedObjectMsgEventProcessor is associated with this object via the initialize() - * method - * @param event the event to handle - * @return true if the provided event should receive no further processing. If false the provided Event should be - * passed to subsequent event processors. - */ - protected boolean handleSharedObjectMsgEvent(ISharedObjectMessageEvent event) { - trace("handleSharedObjectMsgEvent("+event+")"); - if (event instanceof ISharedObjectCreateResponseEvent) return handleSharedObjectCreateResponseEvent((ISharedObjectCreateResponseEvent)event); - else { - SharedObjectMsg msg = getSharedObjectMsgFromEvent(event); - if (msg != null) return handleSharedObjectMsg(msg); - else return false; - } - } - /** - * Handle a ISharedObjectCreateResponseEvent. This handler is called by handleSharedObjectMsgEvent - * when the ISharedObjectMessageEvent is of type ISharedObjectCreateResponseEvent. This default - * implementation simply returns false. Subclasses may override - * as appropriate. Note that if return value is true, it will prevent subsequent event processors from - * having a chance to process event - * @param createResponseEvent the ISharedObjectCreateResponseEvent received - * @return true if the provided event should receive no further processing. If false the provided Event should be - * passed to subsequent event processors. - */ - protected boolean handleSharedObjectCreateResponseEvent(ISharedObjectCreateResponseEvent createResponseEvent) { - trace("handleSharedObjectCreateResponseEvent("+createResponseEvent+")"); - return false; - } - /** - * SharedObjectMsg handler method. This method will be called by {@link #handleSharedObjectMsgEvent(ISharedObjectMessageEvent)} when - * a SharedObjectMsg is received either from a local source or a remote source. This default implementation - * simply returns false so that other processing of of the given msg can occur. Subclasses should override this - * behavior to define custom logic for handling SharedObjectMsgs. - * @param msg the SharedObjectMsg received - * @return true if the msg has been completely handled and subsequent processing should stop. False if processing - * should continue - */ - protected boolean handleSharedObjectMsg(SharedObjectMsg msg) { - trace("handleSharedObjectMsg("+msg+")"); - return false; - } - /** - * Get a ReplicaSharedObjectDescription for a replica to be created on a given receiver. - * - * @param receiver the receiver the ReplicaSharedObjectDescription is for - * @return ReplicaSharedObjectDescription to be associated with given receiver. A non-null - * ReplicaSharedObjectDescription <b>must</b> be returned. - */ - protected ReplicaSharedObjectDescription getReplicaDescription(ID receiver) { - return new ReplicaSharedObjectDescription(getClass(),getID(),getConfig().getHomeContainerID(), - getConfig().getProperties()); - } - /** - * This method is called by replicateToRemoteContainers to - * determine the ReplicaSharedObjectDescriptions associated with the given receivers. Receivers - * may be null (meaning that all in group are to be receivers), and if so then this method - * should return a ReplicaSharedObjectDescription [] of length 1 with a single ReplicaSharedObjectDescription - * that will be used for all receivers. If receivers is non-null, then the ReplicaSharedObjectDescription [] - * result must be of <b>same length</b> as the receivers array. This method calls the - * getReplicaDescription method to create a replica description for each receiver. If this method returns - * null, <b>null replication is done</b>. - * - * @param receivers an ID[] of the intended receivers for the resulting ReplicaSharedObjectDescriptions. If null, - * then the <b>entire current group</b> is assumed to be the target, and this method should return a - * ReplicaSharedObjectDescriptions array of length 1, with a single ReplicaSharedObjectDescriptions for all target receivers. - * - * @return ReplicaSharedObjectDescription[] to determine replica descriptions for each receiver. A null return - * value indicates that no replicas are to be created. If the returned array is not null, then it <b>must</b> - * be of same length as the receivers parameter. - * - */ - protected ReplicaSharedObjectDescription[] getReplicaDescriptions(ID[] receivers) { - ReplicaSharedObjectDescription[] descriptions = null; - if (receivers == null || receivers.length == 1) { - descriptions = new ReplicaSharedObjectDescription[1]; - descriptions[0] = getReplicaDescription((receivers==null)?null:receivers[0]); - } else { - descriptions = new ReplicaSharedObjectDescription[receivers.length]; - for(int i=0; i < receivers.length; i++) { - descriptions[i] = getReplicaDescription(receivers[i]); - } - } - return descriptions; - } - /** - * Replicate this shared object to a given set of remote containers. This - * method will invoke the method getReplicaDescriptions in order to - * determine the set of ReplicaSharedObjectDescriptions to send to remote - * containers. - * - * @param remoteContainers - * the set of remote containers to replicate to. If null, <b>all</b> - * containers in the current group are sent a message to create a - * replica of this shared object. - */ - protected void replicateToRemoteContainers(ID[] remoteContainers) { - if (remoteContainers == null) - trace("replicateTo(null)"); - else - trace("replicateTo(" + Arrays.asList(remoteContainers) + ")"); - try { - // Get current group membership - ISharedObjectContext context = getContext(); - if (context == null) - return; - ID[] group = context.getGroupMemberIDs(); - if (group == null || group.length < 1) { - // we're done - return; - } - ReplicaSharedObjectDescription[] createInfos = getReplicaDescriptions(remoteContainers); - if (createInfos != null) { - if (createInfos.length == 1) { - context.sendCreate((remoteContainers == null) ? null - : remoteContainers[0], createInfos[0]); - } else { - for (int i = 0; i < remoteContainers.length; i++) { - context.sendCreate(remoteContainers[i], createInfos[i]); - } - } - } - } catch (IOException e) { - if (remoteContainers == null) - traceStack("Exception in replicateTo(null)", e); - else - traceStack("Exception in replicateTo(" - + Arrays.asList(remoteContainers) + ")", e); - return; - } - } - -} diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/AbstractSharedObjectContainerAdapterFactory.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/AbstractSharedObjectContainerAdapterFactory.java deleted file mode 100644 index dcce10a70..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/AbstractSharedObjectContainerAdapterFactory.java +++ /dev/null @@ -1,98 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject; - -import java.util.Map; - -import org.eclipse.core.runtime.IAdapterFactory; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.ecf.core.identity.ID; -import org.eclipse.ecf.core.identity.IDFactory; -import org.eclipse.ecf.core.identity.IDCreateException; -import org.eclipse.ecf.internal.core.ECFPlugin; - -public abstract class AbstractSharedObjectContainerAdapterFactory implements - IAdapterFactory { - - protected static final int ADD_ADAPTER_ERROR_CODE = 300001; - - protected static final String ADD_ADAPTER_ERROR_MESSAGE = "Exception adding shared object adapter"; - - private static final int CREATE_ADAPTER_ID_ERROR_CODE = 300002; - - private static final String CREATE_ADAPTER_ID_ERROR_MESSAGE = null; - - protected ID sharedObjectID = null; - - public Object getAdapter(Object adaptableObject, Class adapterType) { - if (ISharedObjectContainer.class.isInstance(adaptableObject)) - return getSharedObjectAdapter( - (ISharedObjectContainer) adaptableObject, adapterType); - else - return null; - } - - protected synchronized ISharedObject getSharedObjectAdapter( - ISharedObjectContainer container, Class adapterType) { - ISharedObjectManager manager = container.getSharedObjectManager(); - // Check to see if the container already has the given shared object - // If so then return it - if (sharedObjectID != null) { - ISharedObject so = manager.getSharedObject(sharedObjectID); - if (so != null) return so; - } - ISharedObject adapter = createAdapter(container, adapterType); - if (adapter == null) - return null; - sharedObjectID = createAdapterID(adapter, - adapterType); - if (sharedObjectID == null) - return null; - Map sharedObjectProperties = createAdapterProperties( - adapter, adapterType); - try { - manager.addSharedObject(sharedObjectID, adapter, - sharedObjectProperties); - } catch (SharedObjectAddException e) { - ECFPlugin.getDefault().getLog().log( - new Status(IStatus.ERROR, ECFPlugin.getDefault() - .getBundle().getSymbolicName(), - ADD_ADAPTER_ERROR_CODE, ADD_ADAPTER_ERROR_MESSAGE, - e)); - return null; - } - return adapter; - } - - protected Map createAdapterProperties( - ISharedObject sharedObjectAdapter, Class adapterType) { - return null; - } - - protected ID createAdapterID(ISharedObject adapter, - Class adapterType) { - String singletonName = adapter.getClass().getName(); - try { - return IDFactory.getDefault().createStringID(singletonName); - } catch (IDCreateException e) { - ECFPlugin.getDefault().getLog().log( - new Status(IStatus.ERROR, ECFPlugin.getDefault() - .getBundle().getSymbolicName(), - CREATE_ADAPTER_ID_ERROR_CODE, CREATE_ADAPTER_ID_ERROR_MESSAGE, - e)); - return null; - } - } - - protected abstract ISharedObject createAdapter(ISharedObjectContainer container, Class adapterType); - - public abstract Class[] getAdapterList(); - -} diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/IReplicaSharedObjectDescriptionFactory.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/IReplicaSharedObjectDescriptionFactory.java deleted file mode 100644 index 5b97c60e6..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/IReplicaSharedObjectDescriptionFactory.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject; - -import org.eclipse.ecf.core.identity.ID; - -public interface IReplicaSharedObjectDescriptionFactory { - /** - * Create new ReplicaSharedObjectDescription instance for delivery to remote - * container identified by containerID parameter. The containerID parameter ID - * provided must not be null - * - * @param containerID - * @return ReplicaSharedObjectDescription. Must not return null, but rather a valid - * ReplicaSharedObjectDescription instance - */ - public ReplicaSharedObjectDescription createDescriptionForContainer(ID containerID, ISharedObjectConfig config); -} diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ISharedObject.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ISharedObject.java deleted file mode 100644 index 693d2f985..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ISharedObject.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.ecf.core.identity.ID; -import org.eclipse.ecf.core.util.IEventHandler; - -/** - * Core interface for implementing components that exist within - * {@link ISharedObjectContainer} - * - */ -public interface ISharedObject extends IAdaptable, IEventHandler { - /** - * Initialize this ISharedObject. The ISharedObjectContainer for this - * ISharedObject must call this method with a non-null instance of - * ISharedObjectConfig. ISharedObject implementations can use this - * initialization to perform any initialization necessary prior to receiving - * any events (via handleEvent/s). Note that the ISharedObjectContext - * provided via the ISharedObjectConfig.getSharedObjectContext() method is - * not guaranteed to allow any method calls until after this init() method - * call has completed. - * - * @param initData - * the initialization data passed by the ISharedObjectContainer - * upon initialization - * @exception SharedObjectInitException - * thrown by ISharedObject to halt initialization. - * ISharedObjectContainers must respond to such an exception - * by halting the addition of the ISharedObject instance and - * treating it as <b>not </b> in the container. - */ - public void init(ISharedObjectConfig initData) - throws SharedObjectInitException; - - /** - * 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. - * - * @param containerID - * the ID of the container that is disposing this ISharedObject - */ - public void dispose(ID containerID); -}
\ No newline at end of file diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ISharedObjectConfig.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ISharedObjectConfig.java deleted file mode 100644 index f45fe1457..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ISharedObjectConfig.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject; - -import java.util.Map; -import org.eclipse.ecf.core.identity.ID; - -/** - * Configuration information provided to ISharedObject via its enclosing - * ISharedObjectContainer - * - * @see ISharedObject#init(ISharedObjectConfig) - */ -public interface ISharedObjectConfig { - /** - * Get the ID associated with this ISharedObject by its container. - * Containers must provide an implementation of this configuration that - * provides a non-null ID instance in response to this method call. - * - * @return ID that ISharedObject can use for imlementing its own - * ISharedObject.getID(). Will not be null. - */ - public ID getSharedObjectID(); - - /** - * Get the ID of the container that is the home of the primary copy of the - * ISharedObject instance. - * - * @return the ID of the container that is the home of the primary copy of - * the ISharedObject instance. Will not be null. - */ - public ID getHomeContainerID(); - - /** - * Get the ISharedObjectContext instance for this ISharedObject. The - * ISharedObjectContext provides access to container-provided services, - * including messaging to remote containers and to remote replicas of the - * ISharedObject, as well as access to OSGI-platform services. - * - * @return ISharedObjectContext for the ISharedObject to use to access - * container and associated services. <b>Will</b> return null - * if context is no longer valid. - */ - public ISharedObjectContext getContext(); - - /** - * Get properties associated with with this ISharedObject - * - * @return Map with properties associated with this ISharedObject instance. Will not be null. - */ - public Map getProperties(); -}
\ No newline at end of file diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ISharedObjectConnector.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ISharedObjectConnector.java deleted file mode 100644 index c465016d7..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ISharedObjectConnector.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject; - -import org.eclipse.ecf.core.identity.ID; -import org.eclipse.ecf.core.sharedobject.events.ISharedObjectEvent; -import org.eclipse.ecf.core.util.AsynchResult; -import org.eclipse.ecf.core.util.QueueException; - -/** - * Implementers which represent the one-way associations between SharedObject - * instances within the scope of a given ISharedObjectContainer - * - * @see ISharedObjectManager#connectSharedObjects(ID, ID[]) - */ -public interface ISharedObjectConnector { - public ID getSender(); - - public ID[] getReceivers(); - - public void enqueue(ISharedObjectEvent event) throws QueueException; - - public void enqueue(ISharedObjectEvent[] events) throws QueueException; - - public AsynchResult[] callAsynch(ISharedObjectEvent arg) throws Exception; - - public void dispose(); -}
\ No newline at end of file diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ISharedObjectContainer.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ISharedObjectContainer.java deleted file mode 100644 index 33771f15b..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ISharedObjectContainer.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject; - -import org.eclipse.ecf.core.IReliableContainer; - -/** - * Core interface that must be implemented by all ECF container instances. - * Instances are typically created via {@link SharedObjectContainerFactory} - */ -public interface ISharedObjectContainer extends IReliableContainer { - /** - * Get SharedObjectManager for this container - * - * @return ISharedObjectManager for this container instance - */ - public ISharedObjectManager getSharedObjectManager(); -}
\ No newline at end of file diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ISharedObjectContainerConfig.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ISharedObjectContainerConfig.java deleted file mode 100644 index 3a0292de1..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ISharedObjectContainerConfig.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject; - -import java.util.Map; - -import org.eclipse.ecf.core.IIdentifiable; - -/** - * Configuration information associated with ISharedObjectContainer. - * - */ -public interface ISharedObjectContainerConfig extends IIdentifiable { - /** - * The properties associated with the owner ISharedObjectContainer - * - * @return Map the properties associated with owner ISharedObjectContainer - */ - public Map getProperties(); - - /** - * 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); -}
\ No newline at end of file diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ISharedObjectContainerFactory.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ISharedObjectContainerFactory.java deleted file mode 100644 index 031c14cbf..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ISharedObjectContainerFactory.java +++ /dev/null @@ -1,77 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject; - -import org.eclipse.ecf.core.ContainerCreateException; -import org.eclipse.ecf.core.ContainerTypeDescription; - -/** - * Factory contract for {@link SharedObjectContainerFactory} - */ -public interface ISharedObjectContainerFactory { - /** - * Make ISharedObjectContainer instance. - * - * @param desc - * the ContainerTypeDescription to use to create the instance - * @param argTypes - * a String [] defining the types of the args parameter - * @param args - * an Object [] of arguments passed to the createInstance method of - * the IContainerInstantiator - * @return a valid instance of ISharedObjectContainer - * @throws ContainerCreateException - */ - public ISharedObjectContainer createSharedObjectContainer( - ContainerTypeDescription desc, String[] argTypes, Object[] args) - throws ContainerCreateException; - - /** - * Make ISharedObjectContainer instance. - * - * @param descriptionName - * the ContainerTypeDescription name to lookup - * @return a valid instance of ISharedObjectContainer - * @throws ContainerCreateException - */ - public ISharedObjectContainer createSharedObjectContainer( - String descriptionName) throws ContainerCreateException; - - /** - * Make ISharedObjectContainer instance. - * - * @param descriptionName - * the ContainerTypeDescription name to lookup - * @param args - * the Object [] of arguments passed to the - * IContainerInstantiator.createInstance method - * @return a valid instance of ISharedObjectContainer - * @throws ContainerCreateException - */ - public ISharedObjectContainer createSharedObjectContainer( - String descriptionName, Object[] args) - throws ContainerCreateException; - - /** - * Make ISharedObjectContainer instance. - * - * @param descriptionName - * the ContainerTypeDescription name to lookup - * @param argsTypes - * the String [] of argument types of the following args - * @param args - * the Object [] of arguments passed to the - * IContainerInstantiator.createInstance method - * @return a valid instance of ISharedObjectContainer - * @throws ContainerCreateException - */ - public ISharedObjectContainer createSharedObjectContainer( - String descriptionName, String[] argsTypes, Object[] args) - throws ContainerCreateException; -}
\ No newline at end of file diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ISharedObjectContainerGroupManager.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ISharedObjectContainerGroupManager.java deleted file mode 100644 index 372d5dc47..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ISharedObjectContainerGroupManager.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject; - -import java.io.Serializable; -import org.eclipse.ecf.core.identity.ID; -import org.eclipse.ecf.core.security.IConnectPolicy; - -/** - * Contract for shared object container group manager (e.g. servers) - */ -public interface ISharedObjectContainerGroupManager { - /** - * Set the join policy for this group manager. If the policy is set to null, - * the implementing container is not obligated to consult the policy. If - * non-null, the given policy's checkJoin method is called before the - * manager agrees to the join of a given group participant. - * - * @param policy - */ - public void setConnectPolicy(IConnectPolicy policy); - - /** - * Eject the given groupMemberID from the current group of containers, for - * the given reason. - * - * @param groupMemberID - * the ID of the group member to eject. If null, or if group - * member is not in group managed by this object, the method has - * no effect - * @param reason - * a reason for the ejection - */ - public void ejectGroupMember(ID groupMemberID, Serializable reason); - - /** - * Eject all, for the given reason. - * - * @param reason - * a reason for the ejection - */ - public void ejectAllGroupMembers(Serializable reason); -} diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ISharedObjectContainerTransaction.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ISharedObjectContainerTransaction.java deleted file mode 100644 index 0d81fd642..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ISharedObjectContainerTransaction.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject; - -/** - * Implementers represent a transaction associated with the creation of a - * SharedObject within the scope of a given SharedObjectContainer - * - */ -public interface ISharedObjectContainerTransaction { - public static final byte ACTIVE = 0; - public static final byte VOTING = 1; - public static final byte PREPARED = 2; - public static final byte COMMITTED = 3; - public static final byte ABORTED = 4; - - /** - * Method called to wait for a transaction to complete. - * - * @throws SharedObjectAddAbortException - */ - public void waitToCommit() throws SharedObjectAddAbortException; - - /** - * Get state of transaction. Returns one of 'ACTIVE', 'VOTING', 'PREPARED', - * 'COMMITTED', or 'ABORTED'. - * - * @return byte code. Returns one of 'ACTIVE', 'VOTING', 'PREPARED', - * 'COMMITTED', or 'ABORTED'. - */ - public byte getTransactionState(); -}
\ No newline at end of file diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ISharedObjectContext.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ISharedObjectContext.java deleted file mode 100644 index 9e8d6ae09..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ISharedObjectContext.java +++ /dev/null @@ -1,202 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject; - -import java.io.IOException; -import java.util.Map; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.ecf.core.ContainerConnectException; -import org.eclipse.ecf.core.IContainer; -import org.eclipse.ecf.core.IOSGIService; -import org.eclipse.ecf.core.identity.ID; -import org.eclipse.ecf.core.identity.Namespace; -import org.eclipse.ecf.core.security.IConnectContext; -import org.eclipse.ecf.core.util.IQueueEnqueue; - -/** - * Context reference provided to all ISharedObjects upon initialization. - * Implementers of this interface provide a runtime context for ISharedObject - * instances. Upon initialization within a container (see - * {@link ISharedObject#init(ISharedObjectConfig)}, ISharedObject instances can - * access an instance of this context by calling - * {@link ISharedObjectConfig#getContext()}. They then can have access to the - * functions provided by this context object for use in implementing their - * behavior. - * - * @see ISharedObject#init - * @see ISharedObjectConfig#getContext() - */ -public interface ISharedObjectContext extends IAdaptable { - public boolean isActive(); - - /** - * Get the local container instance's ID - * - * @return the ID of the enclosing container - */ - public ID getLocalContainerID(); - - /** - * Get the ISharedObjectManager for this context - * - * @return ISharedObjectManager the shared object manager instance for this - * container. Null if none available. - */ - public ISharedObjectManager getSharedObjectManager(); - - /** - * Get the IQueueEnqueue instance associated with this ISharedObject. If the - * given container provides a queue for this ISharedObject, this method will - * return a IQueueEnqueue reference to the appropriate queue. - * - * @return IQueueEnqueue instance if an active queue is associated with this - * ISharedObject. If no active queue is associated with the - * ISharedObject, returns null. - */ - public IQueueEnqueue getQueue(); - - /** - * (non-Javadoc) - * - * @see org.eclipse.ecf.core.IContainer#connect(ID,IConnectContext) - */ - public void connect(ID groupID, IConnectContext connectContext) - throws ContainerConnectException; - - /** - * (non-Javadoc) - * - * @see org.eclipse.ecf.core.IContainer#disconnect() - */ - public void disconnect(); - - /** - * (non-Javadoc) - * - * @see org.eclipse.ecf.core.IContainer#getConnectedID() - */ - public ID getConnectedID(); - - /** - * (non-Javadoc) - * - * @see org.eclipse.ecf.core.sharedobject.ISharedObjectContainer#isGroupManager() - */ - public boolean isGroupManager(); - - /** - * (non-Javadoc) - * - * @see org.eclipse.ecf.core.sharedobject.ISharedObjectContainer#getGroupMemberIDs() - */ - public ID[] getGroupMemberIDs(); - - /** - * Send message to create a remote instance of an ISharedObject with the - * same ID as this instance. This method allows ISharedObject instances - * (with a reference to a valid ISharedObjectContext) to send messages to - * remote containers asking them to create an instance of a new - * ISharedObject. The given ReplicaSharedObjectDescription provides the - * specification of the new object. - * - * @param toContainerID - * the ID of the remote ISharedObjectContainer that is the target - * of the create request. If this parameter is null, the request - * is assumed to be made of <b>all </b> remote containers - * currently in the given group (excepting the local container). - * @param sd - * the ReplicaSharedObjectDescription describing the class, constructor - * and other properties to be associated with the new instance - * @throws IOException - * thrown if message cannot be sent by container - */ - public void sendCreate(ID toContainerID, ReplicaSharedObjectDescription sd) - throws IOException; - - /** - * Send create response back to an ISharedObject with the same ID as this - * instance. This method allows ISharedObject instances (with a reference to - * a valid ISharedObjectContext) to send messages to remote containers - * asking them to deliver the create response status back to the - * ISharedObject. - * - * @param toContainerID - * the ID of the container that is to receive this response - * @param throwable - * a throwable associated with the creation. Null means that no - * exception occured - * @param identifier - * the identifier used in the original create message (in the - * shared object description) - * @exception IOException - * thrown if the create response cannot be sent - */ - public void sendCreateResponse(ID toContainerID, Throwable throwable, - long identifier) throws IOException; - - /** - * Send message to dispose of a remote instance of the ISharedObject with - * same ID as this instance. This method allows ISharedObject instances to - * control the destruction of remote replicas. - * - * @param toContainerID - * the ID of the remote ISharedObjectContainer that is the target - * of the dispose request. If this parameter is null, the request - * is assumed to be made of <b>all </b> remote containers - * currently in the given group (excepting the local container). - * @throws IOException - * thrown if message cannot be sent by container - */ - public void sendDispose(ID toContainerID) throws IOException; - - /** - * Send arbitrary message to remote instance of the ISharedObject with same - * ID as this instance. This method allows ISharedObject instances to send - * arbitrary data to one or more remote replicas of this ISharedObject. - * - * @param toContainerID - * the ID of the remote ISharedObjectContainer that is the target - * container for the message request. If this parameter is null, - * the request is assumed to be made of <b>all </b> remote - * containers currently in the given group (excepting the local - * container). - * @param data - * arbitrary message object. The allowable types of this - * parameter are dependent upon the type of the underlying - * implementing container - * @throws IOException - * thrown if message cannot be sent by container, or if data - * cannot be serialized - */ - public void sendMessage(ID toContainerID, Object data) throws IOException; - - /** - * 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. - * - * @return null if OSGI platform services cannot be accessed, a valid - * instance of the given interface if the context allows access to - * such services - */ - public IOSGIService getServiceAccess(); - /** - * Get the Namespace instance that defines the ID type expected by the remote target container - * @return Namespace the namespace by the target for a call to connect(). Null if container - * namespace no longer available - */ - public Namespace getConnectNamespace(); - - /** - * Get local container properties that it wishes to expose to shared object access - * - * @return Map of properties available to calling shared object. Map returned must not be null. - */ - public Map getLocalContainerProperties(); -}
\ No newline at end of file diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ISharedObjectFactory.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ISharedObjectFactory.java deleted file mode 100644 index 6695f4a9d..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ISharedObjectFactory.java +++ /dev/null @@ -1,158 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject; - -import java.util.List; - -/** - * Container factory contract {@link SharedObjectFactory} for default implementation. - */ -public interface ISharedObjectFactory { - /* - * Add a SharedObjectTypeDescription to the set of known SharedObjectTypeDescriptions. - * - * @param scd the SharedObjectTypeDescription to add to this factory @return - * SharedObjectTypeDescription the old description of the same name, null if none - * found - */ - public SharedObjectTypeDescription addDescription(SharedObjectTypeDescription description); - - /** - * Get a collection of the SharedObjectTypeDescriptions currently known to this - * factory. This allows clients to query the factory to determine what if - * any other SharedObjectTypeDescriptions are currently registered with the - * factory, and if so, what they are. - * - * @return List of SharedObjectTypeDescription instances - */ - public List getDescriptions(); - - /** - * Check to see if a given named description is already contained by this - * factory - * - * @param description - * the SharedObjectTypeDescription to look for - * @return true if description is already known to factory, false otherwise - */ - public boolean containsDescription(SharedObjectTypeDescription description); - - /** - * Get the known SharedObjectTypeDescription given it's name. - * - * @param name - * @return SharedObjectTypeDescription found - * @throws SharedObjectCreateException - */ - public SharedObjectTypeDescription getDescriptionByName(String name) - throws SharedObjectCreateException; - - /** - * Create ISharedObject instance. Given a SharedObjectTypeDescription object, a String [] - * of argument types, and an Object [] of parameters, this method will - * <p> - * <ul> - * <li>lookup the known SharedObjectTypeDescriptions to find one of matching name</li> - * <li>if found, will retrieve or create an ISharedObjectInstantiator for that - * description</li> - * <li>Call the ISharedObjectInstantiator.createInstance method to return an - * instance of ISharedObject</li> - * </ul> - * - * @param typeDescription - * the SharedObjectTypeDescription to use to create the instance - * @param argTypes - * a String [] defining the types of the args parameter - * @param args - * an Object [] of arguments passed to the createInstance method of - * the ISharedObjectInstantiator - * @return a valid instance of ISharedObject - * @throws SharedObjectCreateException - */ - public ISharedObject createSharedObject(SharedObjectTypeDescription typeDescription, - String[] argTypes, Object[] args) - throws SharedObjectCreateException; - - /** - * Create ISharedObject instance. Given a SharedObjectTypeDescription name, this method - * will - * <p> - * <ul> - * <li>lookup the known SharedObjectTypeDescriptions to find one of matching name</li> - * <li>if found, will retrieve or create an ISharedObjectInstantiator for that - * description</li> - * <li>Call the ISharedObjectInstantiator.createInstance method to return an - * instance of ISharedObject</li> - * </ul> - * - * @param descriptionName - * the SharedObjectTypeDescription name to lookup - * @return a valid instance of ISharedObject - * @throws SharedObjectCreateException - */ - public ISharedObject createSharedObject(String descriptionName) - throws SharedObjectCreateException; - - /** - * Create ISharedObject instance. Given a SharedObjectTypeDescription name, this method - * will - * <p> - * <ul> - * <li>lookup the known SharedObjectTypeDescriptions to find one of matching name</li> - * <li>if found, will retrieve or create an ISharedObjectInstantiator for that - * description</li> - * <li>Call the ISharedObjectInstantiator.createInstance method to return an - * instance of ISharedObject</li> - * </ul> - * - * @param descriptionName - * the SharedObjectTypeDescription name to lookup - * @param args - * the Object [] of arguments passed to the - * ISharedObjectInstantiator.createInstance method - * @return a valid instance of IContainer - * @throws SharedObjectCreateException - */ - public ISharedObject createSharedObject(String descriptionName, Object[] args) - throws SharedObjectCreateException; - - /** - * Create ISharedObject instance. Given a SharedObjectTypeDescription name, this method - * will - * <p> - * <ul> - * <li>lookup the known SharedObjectTypeDescriptions to find one of matching name</li> - * <li>if found, will retrieve or create an ISharedObjectInstantiator for that - * description</li> - * <li>Call the ISharedObjectInstantiator.createInstance method to return an - * instance of ISharedObject</li> - * </ul> - * - * @param descriptionName - * the SharedObjectTypeDescription name to lookup - * @param argsTypes - * the String [] of argument types of the following args - * @param args - * the Object [] of arguments passed to the - * ISharedObjectInstantiator.createInstance method - * @return a valid instance of ISharedObject - * @throws SharedObjectCreateException - */ - public ISharedObject createSharedObject(String descriptionName, String[] argsTypes, - Object[] args) throws SharedObjectCreateException; - - /** - * Remove given description from set known to this factory. - * - * @param scd - * the SharedObjectTypeDescription to remove - * @return the removed SharedObjectTypeDescription, null if nothing removed - */ - public SharedObjectTypeDescription removeDescription(SharedObjectTypeDescription scd); -}
\ No newline at end of file diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ISharedObjectManager.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ISharedObjectManager.java deleted file mode 100644 index b1edfaa4c..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ISharedObjectManager.java +++ /dev/null @@ -1,126 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject; - -import java.util.List; -import java.util.Map; -import org.eclipse.ecf.core.identity.ID; -import org.eclipse.ecf.core.security.ISharedObjectPolicy; - -/** - * Manager for creating, disposing, and accessing ISharedObjects from an - * ISharedObjectContainer. - * - * @see ISharedObjectContainer#getSharedObjectManager() - */ -public interface ISharedObjectManager { - /** - * Add an ISharedObject to this container. - * - * @param sharedObjectID - * the ID of new SharedObject - * @param sharedObject - * the ISharedObject instance to add - * @param properties - * the Map associated with the added ISharedObject - * @return ID the sharedObjectID of the added ISharedObject - * @throws SharedObjectAddException - * if the add cannot be accomplished for any reason - */ - public ID addSharedObject(ID sharedObjectID, ISharedObject sharedObject, - Map properties) throws SharedObjectAddException; - - /** - * Create an ISharedObjectConnector instance for sending messages from a - * single ISharedObject to one or more receiver ISharedObjects. All - * specified ISharedObject instances must be contained by this - * ISharedObjectContainer. - * - * @param sharedObjectFrom - * the ID of the sender ISharedObject - * @param sharedObjectsTo - * the ID[] of the receiver ISharedObjects - * @return a valid instance of ISharedObjectConnector. Null if no connector - * can be made - * @throws SharedObjectConnectException - * thrown if specified sender or receivers do not exist within - * the context of this container - */ - public ISharedObjectConnector connectSharedObjects(ID sharedObjectFrom, - ID[] sharedObjectsTo) throws SharedObjectConnectException; - - /** - * Create a new ISharedObject within this container from the given - * SharedObjectDescription. - * - * @param sd - * the SharedObjectDescription that describes the SharedObject to - * be created - * @return ID the sharedObjectID of the added ISharedObject - * @throws SharedObjectCreateException - * if the SharedObject cannot be created - */ - public ID createSharedObject(SharedObjectDescription sd) - throws SharedObjectCreateException; - - /** - * Destroy an ISharedObjectConnector instance. - * - * @param connector - * the connector previously created via connectSharedObjects - * @throws SharedObjectConnectException - * thrown if specified connector does not exist in the context - * of this container - */ - public void disconnectSharedObjects(ISharedObjectConnector connector) - throws SharedObjectDisconnectException; - - /** - * Get the ISharedObject instance corresponding to the given sharedObjectID. - * - * @param sharedObjectID - * of the desired ISharedObject - * @return ISharedObject found. Return null if ISharedObject not found. - */ - public ISharedObject getSharedObject(ID sharedObjectID); - - /** - * Get the sharedObjectConnectors associated with the given sharedObjectID - * - * @return List of ISharedObjectConnector instances - */ - public List getSharedObjectConnectors(ID sharedObjectFrom); - - /** - * Get the array of SharedObject instances currently contained by this - * ISharedObjectContainer - * - * @return ID[] the IDs of currently contained ISharedObject instances - */ - public ID[] getSharedObjectIDs(); - - /** - * Remove the given sharedObjectID from this ISharedObjectContainer. - * - * @param sharedObjectID - * the ID of the ISharedObject to remove - * @return ISharedObject removed. Returns null if ISharedObject not found - */ - public ISharedObject removeSharedObject(ID sharedObjectID); - - /** - * Set this shared object manager's policy for adding remote shared objects. - * - * @param policy - * the ISharedObjectPolicy instance to use to check the validity - * of remote requests to add/replicate a shared object into this - * container - */ - public void setRemoteAddPolicy(ISharedObjectPolicy policy); -} diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ISharedObjectTransactionConfig.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ISharedObjectTransactionConfig.java deleted file mode 100644 index 85b27df03..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ISharedObjectTransactionConfig.java +++ /dev/null @@ -1,34 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2004 Composent, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Composent, Inc. - initial API and implementation - *****************************************************************************/ -package org.eclipse.ecf.core.sharedobject; - - -/** - * Transaction configuration information - * - */ -public interface ISharedObjectTransactionConfig { - public static final int DEFAULT_TIMEOUT = 30000; - /** - * Called by transaction implementation to specify transaction timeout - */ - int getTimeout(); - /** - * Called by transaction implementation to specify filter for determining - * transaction participants - * - * @return {@link ISharedObjectTransactionParticipantsFilter}. If this method returns a - * non-null instance, that instance's - * {@link ISharedObjectTransactionParticipantsFilter#filterParticipants(org.eclipse.ecf.core.identity.ID[]) } - * method will be called - */ - ISharedObjectTransactionParticipantsFilter getParticipantsFilter(); -}
\ No newline at end of file diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ISharedObjectTransactionParticipantsFilter.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ISharedObjectTransactionParticipantsFilter.java deleted file mode 100644 index e11f9ac52..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ISharedObjectTransactionParticipantsFilter.java +++ /dev/null @@ -1,29 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2004 Composent, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Composent, Inc. - initial API and implementation - *****************************************************************************/ -package org.eclipse.ecf.core.sharedobject; - -import org.eclipse.ecf.core.identity.ID; - -/** - * Filter for determining transaction participants - * - */ -public interface ISharedObjectTransactionParticipantsFilter { - /** - * Return ID[] of participants to participate in transacton. - * - * @param currentGroup - * the current set of container group members - * @return intended participants in transaction. If null is returned, all - * group members will be included in transaction. - */ - ID[] filterParticipants(ID[] currentGroup); -} diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/OptimisticSharedObject.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/OptimisticSharedObject.java deleted file mode 100644 index 33a8104a2..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/OptimisticSharedObject.java +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2004 Composent, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Composent, Inc. - initial API and implementation - *****************************************************************************/ -package org.eclipse.ecf.core.sharedobject; - -import org.eclipse.ecf.core.events.IContainerConnectedEvent; -import org.eclipse.ecf.core.identity.ID; -import org.eclipse.ecf.core.sharedobject.events.ISharedObjectActivatedEvent; -import org.eclipse.ecf.core.util.Event; -import org.eclipse.ecf.core.util.IEventProcessor; -import org.eclipse.ecf.core.util.Trace; -import org.eclipse.ecf.internal.core.ECFDebugOptions; -import org.eclipse.ecf.internal.core.ECFPlugin; - -/** - * Superclass for shared object classes that replicate themselves - * optimistically. - * - */ -public class OptimisticSharedObject extends AbstractSharedObject { - - public OptimisticSharedObject() { - super(); - } - protected void trace(String msg) { - Trace.trace(ECFPlugin.getDefault(),getID() + ":" - + (isPrimary() ? "primary:" : "replica:") - + msg); - } - protected void traceStack(String msg, Throwable t) { - Trace.catching(ECFPlugin.getDefault(), ECFDebugOptions.EXCEPTIONS_CATCHING, OptimisticSharedObject.class, getID() + ":" - + (isPrimary() ? "primary" : "replica") - + msg, t); - } - - protected void initialize() throws SharedObjectInitException { - super.initialize(); - trace("initialize()"); - addEventProcessor(new IEventProcessor() { - public boolean processEvent(Event event) { - if (event instanceof ISharedObjectActivatedEvent) { - if (isPrimary() && isConnected()) { - trace("replicating to all"); - OptimisticSharedObject.this - .replicateToRemoteContainers(null); - } - } else if (event instanceof IContainerConnectedEvent) { - if (isPrimary()) { - ID targetID = ((IContainerConnectedEvent) event) - .getTargetID(); - trace("replicating to target="+targetID); - OptimisticSharedObject.this - .replicateToRemoteContainers(new ID[] { targetID }); - } - } - return false; - } - }); - } -} diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ReplicaSharedObjectDescription.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ReplicaSharedObjectDescription.java deleted file mode 100644 index 7972e0286..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/ReplicaSharedObjectDescription.java +++ /dev/null @@ -1,88 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject; - -import java.io.Serializable; -import java.util.Map; -import org.eclipse.ecf.core.identity.ID; - -/** - * Description of a remote ISharedObject instance. - * - */ -public class ReplicaSharedObjectDescription extends SharedObjectDescription - implements Serializable { - private static final long serialVersionUID = 2764430278848370713L; - - protected static long staticID = 0; - public static long getNextUniqueIdentifier() { - return staticID++; - } - - protected ID homeID; - protected long identifier; - - public ReplicaSharedObjectDescription(SharedObjectTypeDescription type, ID objectID, ID homeID, Map props, long ident) { - super(type,objectID,props); - this.homeID = homeID; - this.identifier = ident; - } - public ReplicaSharedObjectDescription(String typeName, ID objectID, ID homeID, Map props, long ident) { - super(new SharedObjectTypeDescription(typeName, null, null, null), objectID, props); - this.homeID = homeID; - this.identifier = ident; - } - public ReplicaSharedObjectDescription(String typeName, ID objectID, ID homeID, Map props) { - this(typeName,objectID,homeID,props,getNextUniqueIdentifier()); - } - public ReplicaSharedObjectDescription(String typeName, ID objectID, ID homeID) { - this(typeName,objectID,homeID,null); - } - public ReplicaSharedObjectDescription(Class clazz, ID objectID, ID homeID, Map props, long ident) { - super(new SharedObjectTypeDescription(clazz.getName(),null),objectID,props); - this.homeID = homeID; - this.identifier = ident; - } - public ReplicaSharedObjectDescription(Class clazz, ID objectID, ID homeID, Map props) { - this(clazz,objectID,homeID,props,getNextUniqueIdentifier()); - } - public ReplicaSharedObjectDescription(Class clazz, ID objectID, ID homeID) { - this(clazz,objectID,homeID,null); - } - public ReplicaSharedObjectDescription(Class clazz, ID objectID) { - this(clazz,objectID,null,null); - } - public ID getHomeID() { - return homeID; - } - public long getIdentifier() { - return identifier; - } - public void setHomeID(ID theID) { - this.homeID = theID; - } - public void setID(ID theID) { - this.id = theID; - } - public void setIdentifier(long identifier) { - this.identifier = identifier; - } - public void setProperties(Map props) { - this.properties = props; - } - public String toString() { - StringBuffer sb = new StringBuffer("ReplicaSharedObjectDescription["); - sb.append("type=").append(typeDescription).append(";"); - sb.append("id:").append(id).append(";"); - sb.append("homeID:").append(homeID).append(";"); - sb.append("props:").append(properties).append(";"); - sb.append("ident:").append(identifier).append("]"); - return sb.toString(); - } -}
\ No newline at end of file diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectAddAbortException.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectAddAbortException.java deleted file mode 100644 index 44eaf6c24..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectAddAbortException.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject; - -import java.util.List; -import java.util.Map; - -public class SharedObjectAddAbortException extends SharedObjectAddException { - private static final long serialVersionUID = 4120851079287223088L; - protected long timeout = -1L; - protected Map causes; - protected List participants; - - public SharedObjectAddAbortException() { - super(); - } - - public SharedObjectAddAbortException(String arg0) { - super(arg0); - } - - public SharedObjectAddAbortException(String msg, Throwable cause) { - super(msg, cause); - } - - public SharedObjectAddAbortException(String msg, Throwable cause, - int timeout) { - super(msg, cause); - this.timeout = timeout; - } - - public SharedObjectAddAbortException(String msg, Map causes, int timeout) { - this(msg, null, causes, timeout); - } - - public SharedObjectAddAbortException(String msg, List participants, - Map causes, int timeout) { - super(msg); - this.participants = participants; - this.causes = causes; - } - - public SharedObjectAddAbortException(Throwable cause) { - super(cause); - } - - public long getTimeout() { - return timeout; - } - - public Map getCauses() { - return causes; - } -}
\ No newline at end of file diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectAddException.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectAddException.java deleted file mode 100644 index ea90f3cd8..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectAddException.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject; - -import org.eclipse.ecf.core.util.ECFException; - -public class SharedObjectAddException extends ECFException { - private static final long serialVersionUID = 3257853198755705913L; - - public SharedObjectAddException() { - super(); - } - - public SharedObjectAddException(String arg0) { - super(arg0); - } - - public SharedObjectAddException(String msg, Throwable cause) { - super(msg, cause); - } - - public SharedObjectAddException(Throwable cause) { - super(cause); - } -}
\ No newline at end of file diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectConnectException.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectConnectException.java deleted file mode 100644 index 65e77fb00..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectConnectException.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject; - -import org.eclipse.ecf.core.util.ECFException; - -public class SharedObjectConnectException extends ECFException { - private static final long serialVersionUID = 3256440287659570228L; - - public SharedObjectConnectException() { - super(); - } - - public SharedObjectConnectException(String arg0) { - super(arg0); - } - - public SharedObjectConnectException(String msg, Throwable cause) { - super(msg, cause); - } - - public SharedObjectConnectException(Throwable cause) { - super(cause); - } -}
\ No newline at end of file diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectContainerFactory.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectContainerFactory.java deleted file mode 100644 index a6ba4f4d4..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectContainerFactory.java +++ /dev/null @@ -1,116 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject; - -import org.eclipse.ecf.core.ContainerCreateException; -import org.eclipse.ecf.core.ContainerFactory; -import org.eclipse.ecf.core.ContainerTypeDescription; -import org.eclipse.ecf.core.IContainer; -import org.eclipse.ecf.core.util.Trace; -import org.eclipse.ecf.internal.core.ECFPlugin; - -/** - * Factory for creating {@link ISharedObjectContainer} instances. This class - * provides ECF clients an entry point to constructing - * {@link ISharedObjectContainer} instances. <br> - * <br> - * Here is an example use of the SharedObjectContainerFactory to construct an - * instance of the 'standalone' container (has no connection to other - * containers): <br> - * <br> - * <code> - * ISharedObjectContainer container = <br> - * SharedObjectContainerFactory.getDefault().createSharedObjectContainer('standalone'); - * <br><br> - * ...further use of container variable here... - * </code> - * - */ -public class SharedObjectContainerFactory implements - ISharedObjectContainerFactory { - protected static ISharedObjectContainerFactory instance = null; - static { - instance = new SharedObjectContainerFactory(); - } - - protected SharedObjectContainerFactory() { - } - - public static ISharedObjectContainerFactory getDefault() { - return instance; - } - - private static void trace(String msg) { - Trace.trace(ECFPlugin.getDefault(),msg); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ecf.core.ISharedObjectContainerFactory#createSharedObjectContainer(org.eclipse.ecf.core.SharedObjectContainerDescription, - * java.lang.String[], java.lang.Object[]) - */ - public ISharedObjectContainer createSharedObjectContainer( - ContainerTypeDescription desc, String[] argTypes, Object[] args) - throws ContainerCreateException { - trace("createSharedObjectContainer(" + desc + "," - + Trace.getArgumentsString(argTypes) + "," - + Trace.getArgumentsString(args) + ")"); - if (desc == null) - throw new ContainerCreateException( - "ContainerTypeDescription cannot be null"); - IContainer newContainer = ContainerFactory.getDefault().createContainer( - desc, argTypes, args); - ISharedObjectContainer soContainer = (ISharedObjectContainer) newContainer - .getAdapter(ISharedObjectContainer.class); - if (soContainer == null) { - newContainer.dispose(); - throw new ContainerCreateException( - "new container is not a shared object container"); - } - return soContainer; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ecf.core.ISharedObjectContainerFactory#createSharedObjectContainer(java.lang.String) - */ - public ISharedObjectContainer createSharedObjectContainer( - String descriptionName) throws ContainerCreateException { - return createSharedObjectContainer(ContainerFactory.getDefault() - .getDescriptionByName(descriptionName), null, null); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ecf.core.ISharedObjectContainerFactory#createSharedObjectContainer(java.lang.String, - * java.lang.Object[]) - */ - public ISharedObjectContainer createSharedObjectContainer( - String descriptionName, Object[] args) - throws ContainerCreateException { - return createSharedObjectContainer(ContainerFactory.getDefault() - .getDescriptionByName(descriptionName), null, args); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ecf.core.ISharedObjectContainerFactory#createSharedObjectContainer(java.lang.String, - * java.lang.String[], java.lang.Object[]) - */ - public ISharedObjectContainer createSharedObjectContainer( - String descriptionName, String[] argsTypes, Object[] args) - throws ContainerCreateException { - return createSharedObjectContainer(ContainerFactory.getDefault() - .getDescriptionByName(descriptionName), argsTypes, args); - } -}
\ No newline at end of file diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectContainerInitException.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectContainerInitException.java deleted file mode 100644 index 862fac8a0..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectContainerInitException.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject; - -import org.eclipse.ecf.core.util.ECFException; - -public class SharedObjectContainerInitException extends ECFException { - private static final long serialVersionUID = 3690189958417888565L; - - public SharedObjectContainerInitException() { - super(); - } - - public SharedObjectContainerInitException(String message) { - super(message); - } - - public SharedObjectContainerInitException(Throwable cause) { - super(cause); - } - - public SharedObjectContainerInitException(String message, Throwable cause) { - super(message, cause); - } -}
\ No newline at end of file diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectCreateException.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectCreateException.java deleted file mode 100644 index 765ca3b29..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectCreateException.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject; - -import org.eclipse.ecf.core.util.ECFException; - -public class SharedObjectCreateException extends ECFException { - private static final long serialVersionUID = 3546919195137815606L; - - public SharedObjectCreateException() { - super(); - } - - public SharedObjectCreateException(String arg0) { - super(arg0); - } - - public SharedObjectCreateException(String msg, Throwable cause) { - super(msg, cause); - } - - public SharedObjectCreateException(Throwable cause) { - super(cause); - } -}
\ No newline at end of file diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectDescription.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectDescription.java deleted file mode 100644 index 1a54305a0..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectDescription.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject; - -import java.io.Serializable; -import java.util.HashMap; -import java.util.Map; -import org.eclipse.ecf.core.identity.ID; - -/** - * Description of a local ISharedObject instance. - * - */ -public class SharedObjectDescription implements Serializable { - private static final long serialVersionUID = -999672007680512082L; - - protected SharedObjectTypeDescription typeDescription; - protected ID id; - protected Map properties; - - protected SharedObjectDescription(SharedObjectTypeDescription typeDescription, ID id, - Map properties) { - this.typeDescription = typeDescription; - this.id = id; - this.properties = properties; - } - protected SharedObjectDescription(SharedObjectTypeDescription typeDescription, ID id) { - this(typeDescription, id, null); - } - public SharedObjectDescription(String typeName, ID id, Map properties) { - this.typeDescription = new SharedObjectTypeDescription(typeName,null,null,null); - this.id = id; - this.properties = properties; - } - public SharedObjectDescription(Class clazz, ID id, Map properties) { - this.typeDescription = new SharedObjectTypeDescription(clazz.getName(),null); - this.id = id; - this.properties = properties; - } - public SharedObjectTypeDescription getTypeDescription() { - return typeDescription; - } - public ID getID() { - return id; - } - public Map getProperties() { - if (properties != null) - return properties; - else - return new HashMap(); - } - public String toString() { - StringBuffer sb = new StringBuffer("SharedObjectDescription["); - sb.append("type=").append(typeDescription).append(";"); - sb.append("id=").append(id).append(";"); - sb.append("props=").append(properties).append(";"); - return sb.toString(); - } -}
\ No newline at end of file diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectDisconnectException.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectDisconnectException.java deleted file mode 100644 index 78874287d..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectDisconnectException.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject; - -import org.eclipse.ecf.core.util.ECFException; - -public class SharedObjectDisconnectException extends ECFException { - private static final long serialVersionUID = 3258689922876586289L; - - public SharedObjectDisconnectException() { - super(); - } - - public SharedObjectDisconnectException(String arg0) { - super(arg0); - } - - public SharedObjectDisconnectException(String msg, Throwable cause) { - super(msg, cause); - } - - public SharedObjectDisconnectException(Throwable cause) { - super(cause); - } -}
\ No newline at end of file diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectFactory.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectFactory.java deleted file mode 100644 index 17aa776bf..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectFactory.java +++ /dev/null @@ -1,211 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject; - -import java.util.ArrayList; -import java.util.Hashtable; -import java.util.List; - -import org.eclipse.ecf.core.sharedobject.provider.ISharedObjectInstantiator; -import org.eclipse.ecf.core.util.AbstractFactory; -import org.eclipse.ecf.core.util.Trace; -import org.eclipse.ecf.internal.core.ECFDebugOptions; -import org.eclipse.ecf.internal.core.ECFPlugin; - -/** - * Factory for creating {@link ISharedObject} instances. This class provides ECF - * clients an entry point to constructing {@link ISharedObject} instances. <br> - */ -public class SharedObjectFactory implements ISharedObjectFactory { - - private static Hashtable sharedobjectdescriptions = new Hashtable(); - protected static ISharedObjectFactory instance = null; - - static { - instance = new SharedObjectFactory(); - } - - protected SharedObjectFactory() { - } - - public static ISharedObjectFactory getDefault() { - return instance; - } - - private static void trace(String msg) { - Trace.trace(ECFPlugin.getDefault(),msg); - } - - private static void dumpStack(String msg, Throwable e) { - Trace.catching(ECFPlugin.getDefault(), ECFDebugOptions.EXCEPTIONS_CATCHING, ECFPlugin.class, "dumpStack", e); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ecf.core.ISharedObjectFactory#addDescription(org.eclipse.ecf.core.SharedObjectTypeDescription) - */ - public SharedObjectTypeDescription addDescription(SharedObjectTypeDescription description) { - trace("addDescription(" + description + ")"); - return addDescription0(description); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ecf.core.ISharedObjectFactory#getDescriptions() - */ - public List getDescriptions() { - return getDescriptions0(); - } - - protected List getDescriptions0() { - return new ArrayList(sharedobjectdescriptions.values()); - } - - protected SharedObjectTypeDescription addDescription0(SharedObjectTypeDescription n) { - if (n == null) - return null; - return (SharedObjectTypeDescription) sharedobjectdescriptions.put(n.getName(), n); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ecf.core.ISharedObjectFactory#containsDescription(org.eclipse.ecf.core.SharedObjectTypeDescription) - */ - public boolean containsDescription(SharedObjectTypeDescription scd) { - return containsDescription0(scd); - } - - protected boolean containsDescription0(SharedObjectTypeDescription scd) { - if (scd == null) - return false; - return sharedobjectdescriptions.containsKey(scd.getName()); - } - - protected SharedObjectTypeDescription getDescription0(SharedObjectTypeDescription scd) { - if (scd == null) - return null; - return (SharedObjectTypeDescription) sharedobjectdescriptions.get(scd.getName()); - } - - protected SharedObjectTypeDescription getDescription0(String name) { - if (name == null) - return null; - return (SharedObjectTypeDescription) sharedobjectdescriptions.get(name); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ecf.core.ISharedObjectContainerFactory#getDescriptionByName(java.lang.String) - */ - public SharedObjectTypeDescription getDescriptionByName(String name) - throws SharedObjectCreateException { - trace("getDescriptionByName(" + name + ")"); - SharedObjectTypeDescription res = getDescription0(name); - if (res == null) { - throw new SharedObjectCreateException( - "SharedObjectCreateException named '" + name + "' not found"); - } - return res; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ecf.core.ISharedObjectContainerFactory#createSharedObject(org.eclipse.ecf.core.SharedObjectTypeDescription, - * java.lang.String[], java.lang.Object[]) - */ - public ISharedObject createSharedObject(SharedObjectTypeDescription desc, - String[] argTypes, Object[] args) - throws SharedObjectCreateException { - trace("createSharedObject(" + desc + "," - + Trace.getArgumentsString(argTypes) + "," - + Trace.getArgumentsString(args) + ")"); - if (desc == null) - throw new SharedObjectCreateException( - "SharedObjectDescription cannot be null"); - SharedObjectTypeDescription cd = getDescription0(desc); - if (cd == null) - throw new SharedObjectCreateException( - "SharedObjectDescription named '" + desc.getName() - + "' not found"); - Class clazzes[] = null; - ISharedObjectInstantiator instantiator = null; - try { - instantiator = (ISharedObjectInstantiator) cd.getInstantiator(); - clazzes = AbstractFactory.getClassesForTypes(argTypes, args, cd - .getClass().getClassLoader()); - } catch (Exception e) { - SharedObjectCreateException newexcept = new SharedObjectCreateException( - "createSharedObject exception with description: " + desc + ": " - + e.getClass().getName() + ": " + e.getMessage()); - newexcept.setStackTrace(e.getStackTrace()); - dumpStack("Exception in createSharedObject", newexcept); - throw newexcept; - } - if (instantiator == null) - throw new SharedObjectCreateException( - "Instantiator for SharedObjectDescription " + cd.getName() - + " is null"); - // Ask instantiator to actually create instance - return (ISharedObject) instantiator.createInstance(desc, clazzes, args); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ecf.core.ISharedObjectContainerFactory#createSharedObject(java.lang.String) - */ - public ISharedObject createSharedObject(String descriptionName) - throws SharedObjectCreateException { - return createSharedObject(getDescriptionByName(descriptionName), null, null); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ecf.core.ISharedObjectContainerFactory#createSharedObject(java.lang.String, - * java.lang.Object[]) - */ - public ISharedObject createSharedObject(String descriptionName, Object[] args) - throws SharedObjectCreateException { - return createSharedObject(getDescriptionByName(descriptionName), null, args); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ecf.core.ISharedObjectContainerFactory#createSharedObject(java.lang.String, - * java.lang.String[], java.lang.Object[]) - */ - public ISharedObject createSharedObject(String descriptionName, String[] argsTypes, - Object[] args) throws SharedObjectCreateException { - return createSharedObject(getDescriptionByName(descriptionName), argsTypes, - args); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ecf.core.ISharedObjectContainerFactory#removeDescription(org.eclipse.ecf.core.SharedObjectTypeDescription) - */ - public SharedObjectTypeDescription removeDescription(SharedObjectTypeDescription scd) { - trace("removeDescription(" + scd + ")"); - return removeDescription0(scd); - } - - protected SharedObjectTypeDescription removeDescription0(SharedObjectTypeDescription n) { - if (n == null) - return null; - return (SharedObjectTypeDescription) sharedobjectdescriptions.remove(n.getName()); - } -}
\ No newline at end of file diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectInitException.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectInitException.java deleted file mode 100644 index 8d3e01a5c..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectInitException.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject; - -import org.eclipse.ecf.core.util.ECFException; - -public class SharedObjectInitException extends ECFException { - private static final long serialVersionUID = 3617579318620862771L; - - public SharedObjectInitException() { - super(); - } - - public SharedObjectInitException(String arg0) { - super(arg0); - } - - public SharedObjectInitException(String msg, Throwable cause) { - super(msg, cause); - } - - public SharedObjectInitException(Throwable cause) { - super(cause); - } -}
\ No newline at end of file diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectMsg.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectMsg.java deleted file mode 100644 index 0e6d7c189..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectMsg.java +++ /dev/null @@ -1,322 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2004 Composent, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Composent, Inc. - initial API and implementation - *****************************************************************************/ -package org.eclipse.ecf.core.sharedobject; - -import java.io.NotSerializableException; -import java.io.Serializable; -import java.lang.reflect.Method; -import java.security.AccessController; -import java.security.PrivilegedActionException; -import java.security.PrivilegedExceptionAction; - -/** - * Shared Object Message. Instances may be used for sending/receiving messages - * among shared object replicas. - * - */ -public class SharedObjectMsg implements Serializable { - private static final long serialVersionUID = -8761203700888592267L; - public static final Object[] nullArgs = new Object[0]; - public static final Class[] nullTypes = new Class[0]; - - protected SharedObjectMsg() {} - // Static factory methods for creating SharedObjectMsg instances - public static SharedObjectMsg createMsg(String className, String methodName, - Object[] param) { - if (methodName == null || param == null) { - throw new NullPointerException( - "Invalid SharedObjectMsg construction"); - } - return new SharedObjectMsg(className, methodName, param); - } - public static SharedObjectMsg createMsg(String methodName, Object[] param) { - return createMsg((String) null, methodName, param); - } - public static SharedObjectMsg createMsg(String methodName) { - return createMsg((String) null, methodName, nullArgs); - } - public static SharedObjectMsg createMsg(String className, String methodName) { - return createMsg(className, methodName, nullArgs); - } - public static SharedObjectMsg createMsg(String className, String methodName, - Object arg) { - Object args[] = { arg }; - return createMsg(className, methodName, args); - } - public static SharedObjectMsg createMsg(String methodName, Object arg) { - return createMsg((String) null, methodName, arg); - } - public static SharedObjectMsg createMsg(String className, String methodName, - Object arg1, Object arg2) { - Object args[] = { arg1, arg2 }; - return createMsg(className, methodName, args); - } - public static SharedObjectMsg createMsg(String className, String methodName, - Object arg1, Object arg2, Object arg3) { - Object args[] = { arg1, arg2, arg3 }; - return createMsg(className, methodName, args); - } - public static SharedObjectMsg createMsg(String className, String methodName, - Object arg1, Object arg2, Object arg3, Object arg4) { - Object args[] = { arg1, arg2, arg3, arg4 }; - return createMsg(className, methodName, args); - } - public static SharedObjectMsg createMsg(String className, String methodName, - Object arg1, Object arg2, Object arg3, Object arg4, Object arg5) { - Object args[] = { arg1, arg2, arg3, arg4, arg5 }; - return createMsg(className, methodName, args); - } - /** - * Utility for getting a Class instance from a String class name. Calls - * Class.forName(). - * - * @param loader - * the ClassLoader to use to load the given class - * @param name - * of Class to load - * @return Class instance found. If not found, a ClassNotFoundException is - * thrown - * @exception ClassNotFoundException - * thrown if specified class is not found - */ - public static Class getClass(ClassLoader loader, String name) - throws ClassNotFoundException { - if (name == null) - return null; - return Class.forName(name, true, loader); - } - /** - * Get name for given class. - * - * @param clazz - * the Class to retrieve the name from - * @return String name of given class - */ - public static String getNameForClass(Class clazz) { - return clazz.getName(); - } - /** - * Get array of argument types from array of objects - * - * @param args the arguments to get types for - * @return Class[] of types for objects in given Object array - */ - public static Class[] getTypesForParameters(Object args[]) { - Class argTypes[] = null; - if (args == null || args.length == 0) - argTypes = nullTypes; - else { - argTypes = new Class[args.length]; - for (int i = 0; i < args.length; i++) { - if (args[i] == null) - argTypes[i] = null; - else - argTypes[i] = args[i].getClass(); - } - } - return argTypes; - } - /** - * Find a Method instance on given class. This method searches for a method - * on the given class (first parameter), of the given name (second - * parameter), with arity defined by the third parameter. Calls - * searchForMethod to actually do the searching. - * - * @param clazz - * the Class to look on - * @param meth - * the method name to look for - * @param args - * the arguments that will be passed to the method on the invoke - * call - * @return Method instance found on given class. Null if none found. - */ - public static Method findMethod(final Class clazz, String meth, - Class args[]) { - Method methods[] = null; - try { - methods = (Method[]) AccessController - .doPrivileged(new PrivilegedExceptionAction() { - public Object run() throws Exception { - return clazz.getDeclaredMethods(); - } - }); - } catch (PrivilegedActionException e) { - return null; - } - return searchForMethod(methods, meth, args); - } - public static Method searchForMethod(Method meths[], String meth, - Class args[]) { - // Find it from among the given set of Method objects - for (int i = 0; i < meths.length; i++) { - Method test = meths[i]; - if (test.getName().equals(meth)) { - if (test.getParameterTypes().length == args.length) - return test; - } - } - return null; - } - /** - * Find a Method instance on given class, and recursively search the class' - * superclass tree for given method. - * - * @param clazz - * the Class to look upon - * @param meth - * the String name of the method to look for - * @param args - * the array of Object arguments that will be passed to the - * method for execution - * @return Method instance if found, null if not found - */ - public static Method findMethodRecursive(Class clazz, String meth, - Class args[]) { - Method aMethod = findMethod(clazz, meth, args); - if (aMethod == null) { - Class superclazz = clazz.getSuperclass(); - if (superclazz != null) - return findMethodRecursive(superclazz, meth, args); - else - return null; - } else { - return aMethod; - } - } - /** - * Check a given msg to verify that all Objects in args array implement the - * Serializable interface. - * - * @param aMsg - * the Message to check - * @exception NotSerializableException - * thrown if any objects in args array do not implement - * java.io.Serializable - */ - public static void checkForSerializable(SharedObjectMsg aMsg) - throws NotSerializableException { - Object args[] = aMsg.getParameters(); - for (int i = 0; i < args.length; i++) { - if (args[i] != null && !(args[i] instanceof Serializable)) - throw new NotSerializableException("Parameter " + i - + " not Serializable"); - } - } - // Instance fields - /** - * @serial clazz the class name for the message - */ - protected String clazz; - /** - * @serial method the method name of the message - */ - protected String method; - /** - * @serial args arguments - */ - protected Object[] parameters; - // Constructor - protected SharedObjectMsg(String className, String methodName, Object[] parameters) { - this.clazz = className; - this.method = methodName; - this.parameters = parameters; - } - public final String getMethod() { - return method; - } - public final void setMethod(String name) { - checkAlterMsg(); - if (name == null) - throw new NullPointerException("methodname cannot be null"); - method = name; - } - /** - * Check if it is permitted to alter the state of this message (args, class - * name, method name). Default: NOP; subclasses should override as - * appropriate. To disallow, throw a java.lang.RuntimeException. - */ - protected void checkAlterMsg() { - // NOP; subclasses should override as appropriate - } - public final String getClassName() { - return clazz; - } - public final void setClassName(String name) { - checkAlterMsg(); - clazz = name; - } - public Object[] getParameters() { - return parameters; - } - public final void setParameters(Object[] args) { - checkAlterMsg(); - args = (args == null) ? nullArgs : args; - } - protected Class[] getParameterTypes() { - return getTypesForParameters(getParameters()); - } - protected final Method findMethod(Class clazz) { - return findMethod(clazz, getMethod(), getParameterTypes()); - } - protected final Method findMethodRecursive(Class clazz) { - return findMethodRecursive(clazz, getMethod(), getParameterTypes()); - } - public final Object invoke(Object target) throws Exception { - return doInvoke(target); - } - Object doInvoke(final Object target) // package scope for security - throws Exception { - if (target == null) - throw new NoSuchMethodException("Null target"); - Method meth = null; - if (clazz == null) { - // If not specific class is specified by SharedObjectMsg instance, - // then use the target's class - meth = findMethodRecursive(target.getClass()); - } else { - // If it is specified, then load the specified class, using the - // target object's classloader - meth = findMethod(getClass(target.getClass().getClassLoader(), - clazz)); - } - // If no method was found, then throw - if (meth == null) - throw new NoSuchMethodException(getMethod()); - final Method toCall = meth; - // Make priveleged call to set the method as accessible - AccessController.doPrivileged(new PrivilegedExceptionAction() { - public Object run() throws Exception { - if (!toCall.isAccessible()) - toCall.setAccessible(true); - return null; - } - }); - // Actually invoke method - return toCall.invoke(target, getParameters()); - } - public String toString() { - StringBuffer sb = new StringBuffer(); - sb.append("SharedObjectMsg[").append(clazz).append(":").append( - method).append("("); - if (parameters == null) { - sb.append(parameters); - } else { - for (int i = 0; i < parameters.length; i++) { - if (i > 0) - sb.append(","); - sb.append(parameters[i]); - } - } - sb.append(")]"); - return sb.toString(); - } -} diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectMsgEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectMsgEvent.java deleted file mode 100644 index 522b6f913..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectMsgEvent.java +++ /dev/null @@ -1,44 +0,0 @@ -/**************************************************************************** -* Copyright (c) 2004 Composent, Inc. and others. -* All rights reserved. This program and the accompanying materials -* are made available under the terms of the Eclipse Public License v1.0 -* which accompanies this distribution, and is available at -* http://www.eclipse.org/legal/epl-v10.html -* -* Contributors: -* Composent, Inc. - initial API and implementation -*****************************************************************************/ - -package org.eclipse.ecf.core.sharedobject; - -import org.eclipse.ecf.core.identity.ID; -import org.eclipse.ecf.core.sharedobject.events.RemoteSharedObjectEvent; - -/** - * Event type to represent messages sent between shared objects - * - */ -public class SharedObjectMsgEvent extends RemoteSharedObjectEvent { - - private static final long serialVersionUID = -8674874265514762123L; - - /** - * @param senderObj - * @param remoteCont - * @param msg - */ - public SharedObjectMsgEvent(ID senderObj, ID remoteCont, SharedObjectMsg msg) { - super(senderObj, remoteCont, msg); - } - - public SharedObjectMsg getSharedObjectMsg() { - return (SharedObjectMsg) super.getData(); - } - - public String toString() { - StringBuffer buf = new StringBuffer("SharedObjectMsgEvent["); - buf.append(getSenderSharedObjectID()).append(";").append(getRemoteContainerID()).append(";").append(getSharedObjectMsg()); - buf.append("]"); - return buf.toString(); - } -} diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectMsgEventProcessor.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectMsgEventProcessor.java deleted file mode 100644 index 1eb22f31a..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectMsgEventProcessor.java +++ /dev/null @@ -1,37 +0,0 @@ -/**************************************************************************** -* Copyright (c) 2004 Composent, Inc. and others. -* All rights reserved. This program and the accompanying materials -* are made available under the terms of the Eclipse Public License v1.0 -* which accompanies this distribution, and is available at -* http://www.eclipse.org/legal/epl-v10.html -* -* Contributors: -* Composent, Inc. - initial API and implementation -*****************************************************************************/ - -package org.eclipse.ecf.core.sharedobject; - -import org.eclipse.ecf.core.sharedobject.events.ISharedObjectMessageEvent; -import org.eclipse.ecf.core.util.Event; -import org.eclipse.ecf.core.util.IEventProcessor; - -/** - * Event processor to process SharedObjectMsgEvents - * - */ -public class SharedObjectMsgEventProcessor implements IEventProcessor { - - AbstractSharedObject sharedObject = null; - - public SharedObjectMsgEventProcessor(AbstractSharedObject sharedObject) { - super(); - this.sharedObject = sharedObject; - } - public boolean processEvent(Event event) { - if (!(event instanceof ISharedObjectMessageEvent)) return false; - return processSharedObjectMsgEvent((ISharedObjectMessageEvent) event); - } - protected boolean processSharedObjectMsgEvent(ISharedObjectMessageEvent event) { - return sharedObject.handleSharedObjectMsgEvent(event); - } -} diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectNotFoundException.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectNotFoundException.java deleted file mode 100644 index aab9ef3ad..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectNotFoundException.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject; - -import org.eclipse.ecf.core.util.ECFException; - -public class SharedObjectNotFoundException extends ECFException { - private static final long serialVersionUID = 3256725086957285689L; - - public SharedObjectNotFoundException() { - super(); - } - - public SharedObjectNotFoundException(String arg0) { - super(arg0); - } - - public SharedObjectNotFoundException(String msg, Throwable cause) { - super(msg, cause); - } - - public SharedObjectNotFoundException(Throwable cause) { - super(cause); - } -}
\ No newline at end of file diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectTypeDescription.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectTypeDescription.java deleted file mode 100644 index c414f24ec..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectTypeDescription.java +++ /dev/null @@ -1,66 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject; - -import java.io.Serializable; -import java.util.Map; - -import org.eclipse.ecf.core.sharedobject.provider.ISharedObjectInstantiator; - -/** - * Description of shared object type. This class provides the information - * necessary to determine the type of a shared object instance. It is used by - * the SharedObjectDescription class to specify the <b>local</b> type of a - * shared object instance, and by ReplicaSharedObjectDescription to specify the - * type of a remote shared object instance - */ -public class SharedObjectTypeDescription implements Serializable { - private static final long serialVersionUID = -553771188695892646L; - - protected String name; - protected ISharedObjectInstantiator instantiator; - protected String description; - protected Map typeProperties; - protected String className; - - public SharedObjectTypeDescription(String name, - ISharedObjectInstantiator instantiator, String desc, Map props) { - this.name = name; - this.instantiator = instantiator; - this.description = desc; - this.typeProperties = props; - } - public SharedObjectTypeDescription(String className, Map props) { - this.className = className; - this.typeProperties = props; - } - public String getClassName() { - return className; - } - public String getDescription() { - return description; - } - public ISharedObjectInstantiator getInstantiator() { - return instantiator; - } - public String getName() { - return name; - } - public Map getTypeProperties() { - return typeProperties; - } - public String toString() { - StringBuffer buf = new StringBuffer("SharedObjectTypeDescription["); - buf.append("name=").append(name).append(";"); - buf.append("instantiator=").append(instantiator).append(";"); - buf.append("className=").append(className).append(";"); - buf.append("typeProperties=").append(typeProperties).append("]"); - return buf.toString(); - } -} diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/TransactionSharedObject.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/TransactionSharedObject.java deleted file mode 100644 index 20b8fbbcd..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/TransactionSharedObject.java +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2004 Composent, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Composent, Inc. - initial API and implementation - *****************************************************************************/ -package org.eclipse.ecf.core.sharedobject; - - -/** - * Superclass for shared object classes that replicate themselves transactionally. - * - */ -public class TransactionSharedObject extends AbstractSharedObject { - - protected ISharedObjectContainerTransaction transaction = null; - protected ISharedObjectTransactionConfig configuration = null; - - public TransactionSharedObject() { - super(); - configuration = new TransactionSharedObjectConfiguration(); - } - public TransactionSharedObject(int timeout) { - super(); - configuration = new TransactionSharedObjectConfiguration(timeout); - } - /** - * Construct instance. The config parameter, if given, is used to - * configure the transactional replication of instances or subclass instances. - * If the config parameter is null, no replication messaging will occur and - * only host instance of object will be created. - * - * @param config - */ - public TransactionSharedObject(ISharedObjectTransactionConfig config) { - super(); - configuration = config; - } - protected void initialize() throws SharedObjectInitException { - super.initialize(); - if (configuration != null) { - TwoPhaseCommitEventProcessor trans = new TwoPhaseCommitEventProcessor(this,configuration); - addEventProcessor(trans); - transaction = trans; - } - } - public Object getAdapter(Class clazz) { - if (clazz.equals(ISharedObjectContainerTransaction.class)) { - return transaction; - } - return null; - } -} diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/TransactionSharedObjectConfiguration.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/TransactionSharedObjectConfiguration.java deleted file mode 100644 index cc0025691..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/TransactionSharedObjectConfiguration.java +++ /dev/null @@ -1,42 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2004 Composent, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Composent, Inc. - initial API and implementation - *****************************************************************************/ -package org.eclipse.ecf.core.sharedobject; - - -/** - * Configuration parameters for transaction shared object creation and replication. - * - */ -public class TransactionSharedObjectConfiguration implements ISharedObjectTransactionConfig { - - protected int timeout = DEFAULT_TIMEOUT; - protected ISharedObjectTransactionParticipantsFilter participantsFilter = null; - - public TransactionSharedObjectConfiguration() { - super(); - } - public TransactionSharedObjectConfiguration(int timeout) { - this(timeout,null); - } - public TransactionSharedObjectConfiguration(int timeout, ISharedObjectTransactionParticipantsFilter filter) { - this.timeout = timeout; - this.participantsFilter = filter; - } - /* (non-Javadoc) - * @see org.eclipse.ecf.core.sharedobject.ITransactionConfiguration#getTimeout() - */ - public int getTimeout() { - return timeout; - } - public ISharedObjectTransactionParticipantsFilter getParticipantsFilter() { - return participantsFilter; - } -} diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/TwoPhaseCommitEventProcessor.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/TwoPhaseCommitEventProcessor.java deleted file mode 100644 index eb3de3fc8..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/TwoPhaseCommitEventProcessor.java +++ /dev/null @@ -1,362 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2004 Composent, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Composent, Inc. - initial API and implementation - *****************************************************************************/ -package org.eclipse.ecf.core.sharedobject; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Vector; -import org.eclipse.ecf.core.events.IContainerConnectedEvent; -import org.eclipse.ecf.core.events.IContainerDisconnectedEvent; -import org.eclipse.ecf.core.identity.ID; -import org.eclipse.ecf.core.sharedobject.events.ISharedObjectActivatedEvent; -import org.eclipse.ecf.core.sharedobject.events.ISharedObjectCommitEvent; -import org.eclipse.ecf.core.sharedobject.events.ISharedObjectCreateResponseEvent; -import org.eclipse.ecf.core.sharedobject.events.ISharedObjectMessageEvent; -import org.eclipse.ecf.core.sharedobject.events.SharedObjectCommitEvent; -import org.eclipse.ecf.core.util.Event; -import org.eclipse.ecf.core.util.IEventProcessor; -import org.eclipse.ecf.core.util.Trace; -import org.eclipse.ecf.internal.core.ECFDebugOptions; -import org.eclipse.ecf.internal.core.ECFPlugin; - -/** - * Implementation of two-phase commit for transactional replication of shared objects. - * - */ -public class TwoPhaseCommitEventProcessor implements IEventProcessor, - ISharedObjectContainerTransaction { - AbstractSharedObject sharedObject = null; - byte transactionState = ISharedObjectContainerTransaction.ACTIVE; - Object lock = new Object(); - List participants = new Vector(); - Map failed = new HashMap(); - int timeout = ISharedObjectTransactionConfig.DEFAULT_TIMEOUT; - int minFailedToAbort = 0; - long identifier = 0; - ISharedObjectTransactionParticipantsFilter participantsFilter = null; - - public TwoPhaseCommitEventProcessor(AbstractSharedObject bse, ISharedObjectTransactionConfig config) { - this.sharedObject = bse; - if (config == null) { - config = new TransactionSharedObjectConfiguration(); - } - this.timeout = config.getTimeout(); - this.participantsFilter = config.getParticipantsFilter(); - } - protected void trace(String msg) { - Trace.trace(ECFPlugin.getDefault(),msg); - } - protected void traceStack(String msg, Throwable t) { - Trace.catching(ECFPlugin.getDefault(), ECFDebugOptions.EXCEPTIONS_CATCHING, TwoPhaseCommitEventProcessor.class, "traceStack", t);; - } - protected int getTimeout() { - return timeout; - } - protected int getMinFailedToAbort() { - return minFailedToAbort; - } - protected boolean isPrimary() { - return getSharedObject().isPrimary(); - } - protected AbstractSharedObject getSharedObject() { - return sharedObject; - } - protected ID getHomeID() { - return getSharedObject().getHomeContainerID(); - } - protected void addParticipants(ID[] ids) { - if (ids != null) { - for (int i = 0; i < ids.length; i++) { - trace("addParticipant(" + ids[i] + ")"); - if (!getHomeID().equals(ids[i])) - participants.add(ids[i]); - } - } - } - protected void removeParticipant(ID id) { - if (id != null) { - trace("removeParticipant(" + id + ")"); - participants.remove(id); - } - } - protected void addFailed(ID remote, Throwable failure) { - if (remote != null && failure != null) { - trace("addFailed(" + remote + "," + failure + ")"); - failed.put(remote, failure); - } - } - protected ISharedObjectContext getContext() { - return getSharedObject().getContext(); - } - /* - * Implementation of IEventProcessor. These methods are entry point methods - * for AbstractSharedObject method dispatch to call - */ - /* - * (non-Javadoc) - * - * @see org.eclipse.ecf.core.util.IEventProcessor#processEvent(org.eclipse.ecf.core.util.Event) - */ - public boolean processEvent(Event event) { - if (event instanceof ISharedObjectActivatedEvent) { - handleActivated((ISharedObjectActivatedEvent) event); - } else if (event instanceof IContainerConnectedEvent) { - handleJoined((IContainerConnectedEvent) event); - } else if (event instanceof ISharedObjectCreateResponseEvent) { - handleCreateResponse((ISharedObjectCreateResponseEvent) event); - } else if (event instanceof IContainerDisconnectedEvent) { - handleDeparted((IContainerDisconnectedEvent) event); - } else if (event instanceof ISharedObjectMessageEvent) { - ISharedObjectMessageEvent some = (ISharedObjectMessageEvent) event; - Object data = some.getData(); - if (data instanceof ISharedObjectCommitEvent) localCommitted(); - } - // Let other event processors have a shot at this event - return false; - } - protected void handleActivated(ISharedObjectActivatedEvent event) { - trace("handleActivated(" + event + ")"); - // No other state changes while this is going on - synchronized (lock) { - if (isPrimary()) { - // Primary - handlePrimaryActivated(event); - } else { - handleReplicaActivated(event); - } - // Notify any threads waiting on state change - lock.notifyAll(); - } - } - protected void replicateTo(ID[] remotes) { - getSharedObject().replicateToRemoteContainers(remotes); - } - - protected void handlePrimaryActivated(ISharedObjectActivatedEvent event) { - trace("handlePrimaryActivated("+event+")"); - // First get current group membership - if (getContext().getConnectedID() != null) { - ID[] groupMembers = getContext().getGroupMemberIDs(); - // Now get participants - ID[] transactionParticipants = null; - // If there is a participants filter specified then use it and ask it to return an ID [] of participants (given - // the current group membership - if (participantsFilter != null) { - transactionParticipants = participantsFilter.filterParticipants(groupMembers); - } - // replicate - if (transactionParticipants == null) { - // This means that all current group members should be included as participants - replicateTo(null); - transactionParticipants = groupMembers; - } else { - // This means the participants filter provided us with an ID [] and so we replicate only to that ID [] - replicateTo(transactionParticipants); - } - - // Add participants to the collection - addParticipants(transactionParticipants); - // Now set transaction state to VOTING - setTransactionState(ISharedObjectContainerTransaction.VOTING); - } else { - setTransactionState(ISharedObjectContainerTransaction.COMMITTED); - } - } - private long getNextIdentifier() { - return identifier++; - } - protected void handleReplicaActivated(ISharedObjectActivatedEvent event) { - trace("handleReplicaActivated("+event+")"); - try { - // Try to respond with create success message back to host - getContext().sendCreateResponse(getHomeID(), null, - getNextIdentifier()); - // If above succeeds, we're now in prepared state - setTransactionState(ISharedObjectContainerTransaction.PREPARED); - } catch (Exception except) { - // If throws exception, we're doomed - traceStack("handleReplicaActivated(" + event + ")", except); - setTransactionState(ISharedObjectContainerTransaction.ABORTED); - } - } - protected void handleJoined(IContainerConnectedEvent event) { - trace("handleJoined(" + event + ")"); - // If we are primary then this event matters to us - if (isPrimary()) { - // If transactionstate is VOTING then we replicate ourselves to participants - if (getTransactionState() == ISharedObjectContainerTransaction.VOTING) { - synchronized (lock) { - // First send replicate message *no matter what state we are in* - ID [] newMember = new ID[] { event.getTargetID() }; - replicateTo(newMember); - addParticipants(newMember); - } - } - } - } - protected void handleCreateResponse(ISharedObjectCreateResponseEvent event) { - trace("handleCreateResponse(" + event + ")"); - if (isPrimary()) { - synchronized (lock) { - Throwable except = event.getException(); - ID remoteID = event.getRemoteContainerID(); - long ident = event.getSequence(); - if (getTransactionState() == ISharedObjectContainerTransaction.VOTING) { - if (except == null) { - removeParticipant(remoteID); - } else { - addFailed(remoteID, except); - } - } else { - handleVotingCompletedCreateResponse(remoteID, except, ident); - } - lock.notifyAll(); - } - } else { - // we don't care as we are note transaction monitor - } - } - protected void handleDeparted(IContainerDisconnectedEvent event) { - trace("handleDeparted(" + event + ")"); - if (isPrimary()) { - ID remoteID = event.getTargetID(); - synchronized (lock) { - if (getTransactionState() == ISharedObjectContainerTransaction.VOTING) { - addFailed(remoteID, new Exception("Container " + remoteID - + " left")); - } - lock.notifyAll(); - } - } else { - // we don't care as we are not transaction monitor - } - } - protected void handleVotingCompletedCreateResponse(ID fromID, Throwable e, - long identifier) { - trace("handleVotingCompletedCreateResponse(" + fromID + ","+e+","+identifier+")"); - // If remote creation was successful, simply send commit message back. - if (e == null) { - try { - getSharedObject().getContext().sendMessage(fromID, - new SharedObjectCommitEvent(getSharedObject().getID())); - } catch (Exception e2) { - traceStack("Exception in sendCommit to " + fromID, e2); - } - } else { - // Too late to vote no - handlePostCommitFailure(fromID, e, identifier); - } - } - protected void handlePostCommitFailure(ID fromID, Throwable e, - long identifier) { - // Do nothing but report - trace("handlePostCommitFailure(" + fromID + "," + e + "," + identifier - + ")"); - } - protected void sendCommit() throws SharedObjectAddAbortException { - try { - getContext().sendMessage(null, - new SharedObjectCommitEvent(getSharedObject().getID())); - } catch (Exception e2) { - doTMAbort(new SharedObjectAddAbortException( - "Exception sending commit message", e2, getTimeout())); - } - } - public byte getTransactionState() { - synchronized (lock) { - return transactionState; - } - } - protected void setTransactionState(byte state) { - synchronized (lock) { - transactionState = state; - } - } - public void waitToCommit() throws SharedObjectAddAbortException { - if (getTransactionState() == ISharedObjectContainerTransaction.COMMITTED) - return; - synchronized (lock) { - long end = System.currentTimeMillis() + getTimeout(); - try { - while (!isVotingCompleted()) { - long wait = end - System.currentTimeMillis(); - trace("waitForFinish waiting " + wait + "ms on " - + getSharedObject().getID()); - if (wait <= 0L) - throw new SharedObjectAddAbortException( - "Timeout adding " + getSharedObject().getID() - + " to " + getHomeID(), - (Throwable) null, getTimeout()); - // Wait right here - lock.wait(wait); - } - } catch (Exception except) { - // Aborted for some reason. Clean up and throw - doTMAbort(except); - } - // Success. Send commit to remotes and clean up before returning. - doTMCommit(); - } - } - protected void doTMAbort(Throwable except) - throws SharedObjectAddAbortException { - trace("doTMAbort:" + except); - // Set our own state variable to ABORTED - setTransactionState(ISharedObjectContainerTransaction.ABORTED); - // Send destroy message here so all remotes get destroyed, and we remove - // ourselves from local space as well. - getSharedObject().destroySelf(); - // throw so caller gets exception and can deal with it - if (except instanceof SharedObjectAddAbortException) - throw (SharedObjectAddAbortException) except; - else - throw new SharedObjectAddAbortException("Aborted", except, - getTimeout()); - } - protected void doTMCommit() throws SharedObjectAddAbortException { - trace("doTMCommit"); - // Make sure we are connected. If so then send commit message - if (getSharedObject().getGroupID() != null) { - sendCommit(); - } - // Call local committed message - localCommitted(); - } - protected void localCommitted() { - trace("localCommitted()"); - // Set state variable to committed. - setTransactionState(ISharedObjectContainerTransaction.COMMITTED); - getSharedObject().creationCompleted(); - } - protected boolean isVotingCompleted() throws SharedObjectAddAbortException { - // The test here is is we've received any indication of failed - // participants in the transaction. If so, we throw. - if (getTransactionState() == ISharedObjectContainerTransaction.COMMITTED) return true; - if (failed.size() > getMinFailedToAbort()) { - // Abort! - trace("isVotingCompleted:aborting:failed>" - + getMinFailedToAbort() + ":failed=" + failed); - throw new SharedObjectAddAbortException("Abort received", - participants, failed, getTimeout()); - // If no problems, and the number of participants to here from is 0, - // then we're done - } else if (getTransactionState() == ISharedObjectContainerTransaction.VOTING - && participants.size() == 0) { - // Success! - trace("isVotingCompleted() returning true"); - return true; - } - // Else continue waiting - trace("isVotingCompleted:false"); - return false; - } -} diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/ISharedObjectActivatedEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/ISharedObjectActivatedEvent.java deleted file mode 100644 index 14c37e9ba..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/ISharedObjectActivatedEvent.java +++ /dev/null @@ -1,16 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject.events; - -import org.eclipse.ecf.core.events.IContainerEvent; -import org.eclipse.ecf.core.identity.ID; - -public interface ISharedObjectActivatedEvent extends IContainerEvent { - public ID getActivatedID(); -}
\ No newline at end of file diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/ISharedObjectCallEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/ISharedObjectCallEvent.java deleted file mode 100644 index 42bd2c868..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/ISharedObjectCallEvent.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject.events; - -import org.eclipse.ecf.core.util.AsynchResult; - -public interface ISharedObjectCallEvent extends ISharedObjectEvent { - AsynchResult getAsynchResult(); -}
\ No newline at end of file diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/ISharedObjectCommitEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/ISharedObjectCommitEvent.java deleted file mode 100644 index 5a96b43c3..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/ISharedObjectCommitEvent.java +++ /dev/null @@ -1,12 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject.events; - -public interface ISharedObjectCommitEvent extends ISharedObjectEvent { -} diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/ISharedObjectCreateResponseEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/ISharedObjectCreateResponseEvent.java deleted file mode 100644 index f5035bbe3..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/ISharedObjectCreateResponseEvent.java +++ /dev/null @@ -1,16 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject.events; - -public interface ISharedObjectCreateResponseEvent extends - ISharedObjectMessageEvent { - public long getSequence(); - - public Throwable getException(); -}
\ No newline at end of file diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/ISharedObjectDeactivatedEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/ISharedObjectDeactivatedEvent.java deleted file mode 100644 index 112fcdefc..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/ISharedObjectDeactivatedEvent.java +++ /dev/null @@ -1,16 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject.events; - -import org.eclipse.ecf.core.events.IContainerEvent; -import org.eclipse.ecf.core.identity.ID; - -public interface ISharedObjectDeactivatedEvent extends IContainerEvent { - public ID getDeactivatedID(); -}
\ No newline at end of file diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/ISharedObjectEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/ISharedObjectEvent.java deleted file mode 100644 index c1481ffde..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/ISharedObjectEvent.java +++ /dev/null @@ -1,18 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject.events; - -import org.eclipse.ecf.core.identity.ID; -import org.eclipse.ecf.core.util.Event; - -public interface ISharedObjectEvent extends Event { - public ID getSenderSharedObjectID(); - - public Event getEvent(); -}
\ No newline at end of file diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/ISharedObjectManagerEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/ISharedObjectManagerEvent.java deleted file mode 100644 index c6cfb37a1..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/ISharedObjectManagerEvent.java +++ /dev/null @@ -1,14 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject.events; - -import org.eclipse.ecf.core.events.IContainerEvent; - -public interface ISharedObjectManagerEvent extends IContainerEvent { -} diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/ISharedObjectMessageEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/ISharedObjectMessageEvent.java deleted file mode 100644 index a66ea811a..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/ISharedObjectMessageEvent.java +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject.events; - -import org.eclipse.ecf.core.identity.ID; - -public interface ISharedObjectMessageEvent extends ISharedObjectEvent { - public ID getRemoteContainerID(); - - public Object getData(); -}
\ No newline at end of file diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/RemoteSharedObjectCreateResponseEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/RemoteSharedObjectCreateResponseEvent.java deleted file mode 100644 index 8a1540cf2..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/RemoteSharedObjectCreateResponseEvent.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject.events; - -import org.eclipse.ecf.core.identity.ID; - -public class RemoteSharedObjectCreateResponseEvent extends - RemoteSharedObjectEvent implements ISharedObjectCreateResponseEvent { - private static final long serialVersionUID = 3618421544527738673L; - long sequence = 0; - - public RemoteSharedObjectCreateResponseEvent(ID senderObj, ID remoteCont, - long seq, Throwable exception) { - super(senderObj, remoteCont, exception); - this.sequence = seq; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ecf.core.events.ISharedObjectCreateResponseEvent#getSequence() - */ - public long getSequence() { - return sequence; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ecf.core.events.ISharedObjectCreateResponseEvent#getException() - */ - public Throwable getException() { - return (Throwable) getData(); - } - - public String toString() { - StringBuffer sb = new StringBuffer( - "RemoteSharedObjectCreateResponseEvent["); - sb.append(getSenderSharedObjectID()).append(";"); - sb.append(getRemoteContainerID()).append(";"); - sb.append(getSequence()).append(";"); - sb.append(getException()).append("]"); - return sb.toString(); - } -}
\ No newline at end of file diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/RemoteSharedObjectEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/RemoteSharedObjectEvent.java deleted file mode 100644 index 8b724874d..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/RemoteSharedObjectEvent.java +++ /dev/null @@ -1,57 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject.events; - -import java.io.Serializable; -import org.eclipse.ecf.core.identity.ID; -import org.eclipse.ecf.core.util.Event; - -public class RemoteSharedObjectEvent implements ISharedObjectMessageEvent, - Serializable { - private static final long serialVersionUID = 3257572797621680182L; - private final ID senderSharedObjectID; - private final ID remoteContainerID; - private final Object data; - - public RemoteSharedObjectEvent(ID senderObj, ID remoteCont, Object data) { - super(); - this.senderSharedObjectID = senderObj; - this.remoteContainerID = remoteCont; - this.data = data; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ecf.api.events.ISharedObjectEvent#getSenderSharedObject() - */ - public ID getSenderSharedObjectID() { - return senderSharedObjectID; - } - - public ID getRemoteContainerID() { - return remoteContainerID; - } - - public Event getEvent() { - return this; - } - - public Object getData() { - return data; - } - - public String toString() { - StringBuffer sb = new StringBuffer("RemoteSharedObjectEvent["); - sb.append(getSenderSharedObjectID()).append(";"); - sb.append(getRemoteContainerID()).append(";"); - sb.append(getData()).append("]"); - return sb.toString(); - } -}
\ No newline at end of file diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/SharedObjectActivatedEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/SharedObjectActivatedEvent.java deleted file mode 100644 index 9fa91ab03..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/SharedObjectActivatedEvent.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject.events; - -import org.eclipse.ecf.core.identity.ID; - -public class SharedObjectActivatedEvent implements ISharedObjectActivatedEvent { - private static final long serialVersionUID = 6880286157835412766L; - private final ID activatedID; - private final ID localContainerID; - - public SharedObjectActivatedEvent(ID container, ID act) { - super(); - this.localContainerID = container; - this.activatedID = act; - } - - public ID getActivatedID() { - return activatedID; - } - - public ID getLocalContainerID() { - return localContainerID; - } - - public String toString() { - StringBuffer sb = new StringBuffer("SharedObjectActivatedEvent["); - sb.append(getLocalContainerID()).append(";"); - sb.append(getActivatedID()).append("]"); - return sb.toString(); - } -}
\ No newline at end of file diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/SharedObjectCallEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/SharedObjectCallEvent.java deleted file mode 100644 index 8ec7c88c6..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/SharedObjectCallEvent.java +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** -* Copyright (c) 2004 Composent, Inc. and others. -* All rights reserved. This program and the accompanying materials -* are made available under the terms of the Eclipse Public License v1.0 -* which accompanies this distribution, and is available at -* http://www.eclipse.org/legal/epl-v10.html -* -* Contributors: -* Composent, Inc. - initial API and implementation -*****************************************************************************/ - -package org.eclipse.ecf.core.sharedobject.events; - -import org.eclipse.ecf.core.identity.ID; -import org.eclipse.ecf.core.util.AsynchResult; -import org.eclipse.ecf.core.util.Event; - -public class SharedObjectCallEvent implements ISharedObjectCallEvent { - private static final long serialVersionUID = 3904674977264250933L; - ID sender; - Event event; - AsynchResult result; - - public SharedObjectCallEvent(ID sender, Event evt, AsynchResult res) { - super(); - this.sender = sender; - this.event = evt; - this.result = res; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ecf.core.events.ISharedObjectCallEvent#getAsynchResult() - */ - public AsynchResult getAsynchResult() { - return result; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ecf.core.events.ISharedObjectEvent#getSenderSharedObjectID() - */ - public ID getSenderSharedObjectID() { - return sender; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ecf.core.events.ISharedObjectEvent#getEvent() - */ - public Event getEvent() { - return event; - } -}
\ No newline at end of file diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/SharedObjectCommitEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/SharedObjectCommitEvent.java deleted file mode 100644 index df5ca6e1c..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/SharedObjectCommitEvent.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject.events; - -import org.eclipse.ecf.core.identity.ID; -import org.eclipse.ecf.core.util.Event; - -public class SharedObjectCommitEvent implements ISharedObjectCommitEvent { - private static final long serialVersionUID = 4615634472917480497L; - ID senderSharedObjectID = null; - Event event = null; - - public SharedObjectCommitEvent(ID senderSharedObjectID, Event event) { - super(); - this.senderSharedObjectID = senderSharedObjectID; - this.event = event; - } - - public SharedObjectCommitEvent(ID senderSharedObjectID) { - this(senderSharedObjectID, null); - } - - public ID getSenderSharedObjectID() { - return senderSharedObjectID; - } - - public Event getEvent() { - return event; - } - - public String toString() { - StringBuffer sb = new StringBuffer("SharedObjectCommitEvent["); - sb.append(getSenderSharedObjectID()).append(";"); - sb.append(getEvent()).append("]"); - return sb.toString(); - } -} diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/SharedObjectDeactivatedEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/SharedObjectDeactivatedEvent.java deleted file mode 100644 index 9367eadbf..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/SharedObjectDeactivatedEvent.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject.events; - -import org.eclipse.ecf.core.identity.ID; - -public class SharedObjectDeactivatedEvent implements - ISharedObjectDeactivatedEvent { - private static final long serialVersionUID = 3257291344119476786L; - private final ID deactivatedID; - private final ID localContainerID; - - public SharedObjectDeactivatedEvent(ID container, ID deact) { - super(); - this.localContainerID = container; - this.deactivatedID = deact; - } - - public ID getDeactivatedID() { - return deactivatedID; - } - - public ID getLocalContainerID() { - return localContainerID; - } - - public String toString() { - StringBuffer sb = new StringBuffer("SharedObjectDeactivatedEvent["); - sb.append(getLocalContainerID()).append(";"); - sb.append(getDeactivatedID()).append("]"); - return sb.toString(); - } -}
\ No newline at end of file diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/SharedObjectManagerAddEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/SharedObjectManagerAddEvent.java deleted file mode 100644 index f4a34a49d..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/SharedObjectManagerAddEvent.java +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject.events; - -import java.util.Map; -import org.eclipse.ecf.core.identity.ID; -import org.eclipse.ecf.core.sharedobject.ISharedObject; - -/** - * @author slewis - * - */ -public class SharedObjectManagerAddEvent implements ISharedObjectManagerEvent { - private static final long serialVersionUID = 3258413923916330551L; - ID localContainerID = null; - Map properties = null; - ISharedObject sharedObject = null; - ID sharedObjectID = null; - - public SharedObjectManagerAddEvent(ID localContainerID, ID sharedObjectID, - ISharedObject object, Map properties) { - this.localContainerID = localContainerID; - this.sharedObjectID = sharedObjectID; - this.sharedObject = object; - this.properties = properties; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ecf.core.events.IContainerEvent#getLocalContainerID() - */ - public ID getLocalContainerID() { - return localContainerID; - } - - public Map getProperties() { - return properties; - } - - public ISharedObject getSharedObject() { - return sharedObject; - } - - public ID getSharedObjectID() { - return sharedObjectID; - } - - public String toString() { - StringBuffer buf = new StringBuffer("SharedObjectManagerAddEvent["); - buf.append(getLocalContainerID()).append(";"); - buf.append(getSharedObjectID()).append(";"); - buf.append(getSharedObject()).append(";"); - buf.append(getProperties()).append("]"); - return buf.toString(); - } -} diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/SharedObjectManagerConnectEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/SharedObjectManagerConnectEvent.java deleted file mode 100644 index 030c9c7b3..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/SharedObjectManagerConnectEvent.java +++ /dev/null @@ -1,57 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject.events; - -import java.util.Arrays; -import org.eclipse.ecf.core.identity.ID; - -/** - * @author slewis - * - */ -public class SharedObjectManagerConnectEvent implements - ISharedObjectManagerEvent { - private static final long serialVersionUID = 3544670676712633650L; - ID localContainerID = null; - ID[] sharedObjectReceiverIDs = null; - ID sharedObjectSenderID = null; - - public SharedObjectManagerConnectEvent(ID localContainerID, - ID sharedObjectSenderID, ID[] sharedObjectReceiverIDs) { - this.localContainerID = localContainerID; - this.sharedObjectSenderID = sharedObjectSenderID; - this.sharedObjectReceiverIDs = sharedObjectReceiverIDs; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ecf.core.events.IContainerEvent#getLocalContainerID() - */ - public ID getLocalContainerID() { - return localContainerID; - } - - public ID[] getSharedObjectReceiverIDs() { - return (sharedObjectReceiverIDs == null) ? new ID[0] - : sharedObjectReceiverIDs; - } - - public ID getSharedObjectSenderID() { - return sharedObjectSenderID; - } - - public String toString() { - StringBuffer buf = new StringBuffer("SharedObjectManagerConnectEvent["); - buf.append(getLocalContainerID()).append(";"); - buf.append(getSharedObjectSenderID()).append(";"); - buf.append(Arrays.asList(getSharedObjectReceiverIDs())).append("]"); - return buf.toString(); - } -} diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/SharedObjectManagerCreateEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/SharedObjectManagerCreateEvent.java deleted file mode 100644 index 8229b4b04..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/SharedObjectManagerCreateEvent.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject.events; - -import org.eclipse.ecf.core.identity.ID; -import org.eclipse.ecf.core.sharedobject.SharedObjectDescription; - -/** - * @author slewis - * - */ -public class SharedObjectManagerCreateEvent implements - ISharedObjectManagerEvent { - private static final long serialVersionUID = 3905527103070878006L; - SharedObjectDescription description = null; - ID localContainerID = null; - - public SharedObjectManagerCreateEvent(ID localContainerID, - SharedObjectDescription description) { - this.localContainerID = localContainerID; - this.description = description; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ecf.core.events.IContainerEvent#getLocalContainerID() - */ - public ID getLocalContainerID() { - return localContainerID; - } - - public SharedObjectDescription getDescription() { - return description; - } - - public String toString() { - StringBuffer buf = new StringBuffer("SharedObjectManagerCreateEvent["); - buf.append(getLocalContainerID()).append(";"); - buf.append(getDescription()).append("]"); - return buf.toString(); - } -} diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/SharedObjectManagerDisconnectEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/SharedObjectManagerDisconnectEvent.java deleted file mode 100644 index 2dc0c9536..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/SharedObjectManagerDisconnectEvent.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject.events; - -import org.eclipse.ecf.core.identity.ID; - -/** - * @author slewis - * - */ -public class SharedObjectManagerDisconnectEvent implements - ISharedObjectManagerEvent { - private static final long serialVersionUID = 3257008743777448761L; - ID localContainerID = null; - ID sharedObjectSenderID = null; - - public SharedObjectManagerDisconnectEvent(ID localContainerID, - ID sharedObjectSenderID) { - this.localContainerID = localContainerID; - this.sharedObjectSenderID = sharedObjectSenderID; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ecf.core.events.IContainerEvent#getLocalContainerID() - */ - public ID getLocalContainerID() { - return localContainerID; - } - - public ID getSharedObjectSenderID() { - return sharedObjectSenderID; - } - - public String toString() { - StringBuffer buf = new StringBuffer( - "SharedObjectManagerDisconnectEvent["); - buf.append(getLocalContainerID()).append(";"); - buf.append(getSharedObjectSenderID()).append(";"); - return buf.toString(); - } -} diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/SharedObjectManagerRemoveEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/SharedObjectManagerRemoveEvent.java deleted file mode 100644 index 3e7e94864..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/events/SharedObjectManagerRemoveEvent.java +++ /dev/null @@ -1,47 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject.events; - -import org.eclipse.ecf.core.identity.ID; - -/** - * @author slewis - * - */ -public class SharedObjectManagerRemoveEvent implements - ISharedObjectManagerEvent { - private static final long serialVersionUID = 3256728389754106931L; - ID sharedObjectID = null; - ID localContainerID = null; - - public SharedObjectManagerRemoveEvent(ID localContainerID, ID sharedObjectID) { - this.localContainerID = localContainerID; - this.sharedObjectID = sharedObjectID; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ecf.core.events.IContainerEvent#getLocalContainerID() - */ - public ID getLocalContainerID() { - return localContainerID; - } - - public ID getSharedObjectID() { - return sharedObjectID; - } - - public String toString() { - StringBuffer buf = new StringBuffer("SharedObjectManagerRemoveEvent["); - buf.append(getLocalContainerID()).append(";"); - buf.append(getSharedObjectID()).append("]"); - return buf.toString(); - } -} diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/provider/ISharedObjectInstantiator.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/provider/ISharedObjectInstantiator.java deleted file mode 100644 index 1bdb4f059..000000000 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/provider/ISharedObjectInstantiator.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.ecf.core.sharedobject.provider; - -import org.eclipse.ecf.core.sharedobject.ISharedObject; -import org.eclipse.ecf.core.sharedobject.SharedObjectCreateException; -import org.eclipse.ecf.core.sharedobject.SharedObjectTypeDescription; - -/** - * Interface that must be implemented by extensions of the sharedObjectFactory extension point - * - */ -public interface ISharedObjectInstantiator { - /** - * Create instance of ISharedObject. This is the interface that plugin implementations - * must implement for the sharedObjectFactory extension point. The caller may optionally - * specify both argument types and arguments that will be passed into this method (and - * therefore to the provider implementation implementing this method). For example: - * <p></p><p><b> SharedObjectFactory.getDefault().createSharedObject("foosharedobject",new String [] { java.lang.String }, new Object { "hello" });</b></p><p></p> - * - * @param typeDescription the SharedObjectTypeDescription associated with the registered shared object provider - * implementation plugin - * @param argTypes the argument types specified by the caller. May be null if no - * arguments are passed in by caller to SharedObjectFactory.getDefault().createSharedObject(...) - * @param args arguments specified by the caller. May be null if no - * arguments are passed in by caller to SharedObjectFactory.getDefault().createSharedObject(...) - * @return ISharedObject instance. The provider implementation must return a valid object - * implementing ISharedObject OR throw a SharedObjectCreateException - * @throws SharedObjectCreateException TODO - */ - public ISharedObject createInstance(SharedObjectTypeDescription typeDescription, - Class[] argTypes, Object[] args) - throws SharedObjectCreateException; -}
\ No newline at end of file diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/ECFPlugin.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/ECFPlugin.java index 31d001de9..8b7b57284 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/ECFPlugin.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/ECFPlugin.java @@ -35,10 +35,12 @@ import org.eclipse.ecf.core.comm.ConnectionFactory; import org.eclipse.ecf.core.comm.ConnectionTypeDescription; import org.eclipse.ecf.core.comm.provider.ISynchAsynchConnectionInstantiator; import org.eclipse.ecf.core.provider.IContainerInstantiator; +/* import org.eclipse.ecf.core.sharedobject.ISharedObjectFactory; import org.eclipse.ecf.core.sharedobject.SharedObjectFactory; import org.eclipse.ecf.core.sharedobject.SharedObjectTypeDescription; import org.eclipse.ecf.core.sharedobject.provider.ISharedObjectInstantiator; +*/ import org.eclipse.ecf.core.start.ECFStartJob; import org.eclipse.ecf.core.start.IECFStart; import org.eclipse.ecf.core.util.Trace; @@ -52,8 +54,6 @@ public class ECFPlugin extends Plugin { public static final String NAMESPACE_EPOINT = ECFNAMESPACE + ".namespace"; public static final String CONTAINER_FACTORY_EPOINT = ECFNAMESPACE + ".containerFactory"; - public static final String SHAREDOBJECT_FACTORY_EPOINT = ECFNAMESPACE - + ".sharedObjectFactory"; public static final String COMM_FACTORY_EPOINT = ECFNAMESPACE + ".connectionFactory"; public static final String START_EPOINT = ECFNAMESPACE + ".startup"; @@ -291,110 +291,6 @@ public class ECFPlugin extends Plugin { addContainerFactoryExtensions(extensionPoint.getConfigurationElements()); } /** - * Remove extensions for shared object extension point - * - * @param members - * the members to remove - */ - protected void removeSharedObjectExtensions(IConfigurationElement[] members) { - String bundleName = getDefault().getBundle().getSymbolicName(); - for (int m = 0; m < members.length; m++) { - IConfigurationElement member = members[m]; - String name = null; - IExtension extension = member.getDeclaringExtension(); - try { - name = member.getAttribute(NAME_ATTRIBUTE); - if (name == null) { - name = member.getAttribute(CLASS_ATTRIBUTE); - } - if (name == null) - continue; - ISharedObjectFactory factory = SharedObjectFactory.getDefault(); - SharedObjectTypeDescription sd = factory - .getDescriptionByName(name); - if (sd == null || !factory.containsDescription(sd)) { - continue; - } - // remove - factory.removeDescription(sd); - debug("removeSharedObjectExtensions:removed description from factory:" - + sd); - } catch (Exception e) { - log(getStatusForContException(extension, bundleName, name)); - dumpStack("Exception in removeSharedObjectExtensions", e); - } - } - } - /** - * Add shared object extension point extensions - * - * @param members - * to add - */ - protected void addSharedObjectExtensions(IConfigurationElement[] members) { - String bundleName = getDefault().getBundle().getSymbolicName(); - // For each configuration element - for (int m = 0; m < members.length; m++) { - IConfigurationElement member = members[m]; - // Get the label of the extender plugin and the ID of the extension. - IExtension extension = member.getDeclaringExtension(); - ISharedObjectInstantiator exten = null; - String name = null; - try { - // The only required attribute is "class" - exten = (ISharedObjectInstantiator) member - .createExecutableExtension(CLASS_ATTRIBUTE); - name = member.getAttribute(NAME_ATTRIBUTE); - if (name == null) { - name = member.getAttribute(CLASS_ATTRIBUTE); - } - // Get description, if present - String description = member.getAttribute(DESCRIPTION_ATTRIBUTE); - if (description == null) { - description = ""; - } - // Get any property elements - Map properties = getProperties(member - .getChildren(PROPERTY_ELEMENT_NAME)); - // Now make description instance - SharedObjectTypeDescription scd = new SharedObjectTypeDescription( - name, exten, description, properties); - debug("setupSharedObjectExtensionPoint:created description:" - + scd); - ISharedObjectFactory factory = SharedObjectFactory.getDefault(); - if (factory.containsDescription(scd)) { - throw new CoreException(getStatusForContException( - extension, bundleName, name)); - } - // Now add the description and we're ready to go. - factory.addDescription(scd); - debug("setupSharedObjectExtensionPoint:added description to factory:" - + scd); - } catch (CoreException e) { - log(e.getStatus()); - dumpStack("CoreException in setupSharedObjectExtensionPoint", e); - } catch (Exception e) { - log(getStatusForContException(extension, bundleName, name)); - dumpStack("Exception in setupSharedObjectExtensionPoint", e); - } - } - } - /** - * Setup shared object extension point - * - * @param context - * the BundleContext for this bundle - */ - protected void setupSharedObjectExtensionPoint(BundleContext bc) { - IExtensionRegistry reg = Platform.getExtensionRegistry(); - IExtensionPoint extensionPoint = reg - .getExtensionPoint(SHAREDOBJECT_FACTORY_EPOINT); - if (extensionPoint == null) { - return; - } - addSharedObjectExtensions(extensionPoint.getConfigurationElements()); - } - /** * Remove extensions for comm extension point * * @param members @@ -588,7 +484,7 @@ public class ECFPlugin extends Plugin { registryManager); setupContainerFactoryExtensionPoint(context); setupCommExtensionPoint(context); - setupSharedObjectExtensionPoint(context); + //setupSharedObjectExtensionPoint(context); setupStartExtensionPoint(context); } protected class ECFRegistryManager implements IRegistryChangeListener { @@ -607,6 +503,7 @@ public class ECFPlugin extends Plugin { break; } } + /* delta = event.getExtensionDeltas(ECFNAMESPACE, "sharedObjectFactory"); for (int i = 0; i < delta.length; i++) { @@ -621,6 +518,7 @@ public class ECFPlugin extends Plugin { break; } } + */ delta = event.getExtensionDeltas(ECFNAMESPACE, "connectionFactory"); for (int i = 0; i < delta.length; i++) { switch (delta[i].getKind()) { |