diff options
author | mkuppe | 2009-02-20 08:54:54 +0000 |
---|---|---|
committer | mkuppe | 2009-02-20 08:54:54 +0000 |
commit | 0e859c9d767236a10b8c7d16578be910d7050184 (patch) | |
tree | dee15410a5c5479f04006d3538548924612fa8e9 /providers/bundles/org.eclipse.ecf.provider.discovery | |
parent | 823b8577c66ab314df4f1d5a165fc4116d1ff83f (diff) | |
download | org.eclipse.ecf-0e859c9d767236a10b8c7d16578be910d7050184.tar.gz org.eclipse.ecf-0e859c9d767236a10b8c7d16578be910d7050184.tar.xz org.eclipse.ecf-0e859c9d767236a10b8c7d16578be910d7050184.zip |
NEW - bug 249240: [remotesvcs] Implement RFC 119
https://bugs.eclipse.org/bugs/show_bug.cgi?id=249240
APITooling for String [] getSupportedIntents();
Diffstat (limited to 'providers/bundles/org.eclipse.ecf.provider.discovery')
2 files changed, 40 insertions, 27 deletions
diff --git a/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/provider/discovery/CompositeDiscoveryContainerInstantiator.java b/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/provider/discovery/CompositeDiscoveryContainerInstantiator.java index 117026459..472d4e7ac 100644 --- a/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/provider/discovery/CompositeDiscoveryContainerInstantiator.java +++ b/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/provider/discovery/CompositeDiscoveryContainerInstantiator.java @@ -11,8 +11,15 @@ package org.eclipse.ecf.provider.discovery; -import java.util.*; -import org.eclipse.ecf.core.*; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +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.IContainerFactory; import org.eclipse.ecf.core.identity.IDCreateException; import org.eclipse.ecf.core.provider.IContainerInstantiator; import org.eclipse.ecf.discovery.IDiscoveryContainerAdapter; @@ -26,28 +33,28 @@ public class CompositeDiscoveryContainerInstantiator implements IContainerInstan * @see org.eclipse.ecf.core.provider.IContainerInstantiator#createInstance(org.eclipse.ecf.core.ContainerTypeDescription, * java.lang.Object[]) */ - public IContainer createInstance(ContainerTypeDescription description, Object[] parameters) throws ContainerCreateException { + public IContainer createInstance(final ContainerTypeDescription description, final Object[] parameters) throws ContainerCreateException { try { - IContainerFactory factory = ContainerFactory.getDefault(); - List containers = new ArrayList(); - List list = factory.getDescriptions(); - for (Iterator itr = list.iterator(); itr.hasNext();) { - ContainerTypeDescription ctd = (ContainerTypeDescription) itr.next(); - String name = ctd.getName(); + final IContainerFactory factory = ContainerFactory.getDefault(); + final List containers = new ArrayList(); + final List list = factory.getDescriptions(); + for (final Iterator itr = list.iterator(); itr.hasNext();) { + final ContainerTypeDescription ctd = (ContainerTypeDescription) itr.next(); + final String name = ctd.getName(); if (!name.equals("ecf.discovery.*") //$NON-NLS-1$ && name.startsWith("ecf.discovery.")) { //$NON-NLS-1$ - IContainer container = factory.createContainer(ctd.getName()); + final IContainer container = factory.createContainer(ctd.getName()); containers.add(container); } } return new CompositeDiscoveryContainer(containers); - } catch (IDCreateException e) { - ContainerCreateException excep = new ContainerCreateException(Messages.CompositeDiscoveryContainerInstantiator); + } catch (final IDCreateException e) { + final ContainerCreateException excep = new ContainerCreateException(Messages.CompositeDiscoveryContainerInstantiator); excep.setStackTrace(e.getStackTrace()); throw excep; - } catch (ContainerCreateException e) { - ContainerCreateException excep = new ContainerCreateException(Messages.CompositeDiscoveryContainerInstantiator); + } catch (final ContainerCreateException e) { + final ContainerCreateException excep = new ContainerCreateException(Messages.CompositeDiscoveryContainerInstantiator); excep.setStackTrace(e.getStackTrace()); throw excep; } @@ -58,7 +65,7 @@ public class CompositeDiscoveryContainerInstantiator implements IContainerInstan * * @see org.eclipse.ecf.core.provider.IContainerInstantiator#getSupportedAdapterTypes(org.eclipse.ecf.core.ContainerTypeDescription) */ - public String[] getSupportedAdapterTypes(ContainerTypeDescription description) { + public String[] getSupportedAdapterTypes(final ContainerTypeDescription description) { return new String[] {IDiscoveryContainerAdapter.class.getName()}; } @@ -67,10 +74,13 @@ public class CompositeDiscoveryContainerInstantiator implements IContainerInstan * * @see org.eclipse.ecf.core.provider.IContainerInstantiator#getSupportedParameterTypes(org.eclipse.ecf.core.ContainerTypeDescription) */ - public Class[][] getSupportedParameterTypes(ContainerTypeDescription description) { + public Class[][] getSupportedParameterTypes(final ContainerTypeDescription description) { return new Class[0][0]; } + /* (non-Javadoc) + * @see org.eclipse.ecf.core.provider.IContainerInstantiator#getSupportedIntents(org.eclipse.ecf.core.ContainerTypeDescription) + */ public String[] getSupportedIntents(ContainerTypeDescription description) { return null; } diff --git a/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/provider/discovery/SingletonDiscoveryContainerInstantiator.java b/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/provider/discovery/SingletonDiscoveryContainerInstantiator.java index 7ac5e789f..c689984c2 100644 --- a/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/provider/discovery/SingletonDiscoveryContainerInstantiator.java +++ b/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/provider/discovery/SingletonDiscoveryContainerInstantiator.java @@ -23,15 +23,15 @@ public class SingletonDiscoveryContainerInstantiator implements IContainerInstan private static IContainer INSTANCE; - private static synchronized IContainer getInstance(String containerName) throws ContainerCreateException { + private static synchronized IContainer getInstance(final String containerName) throws ContainerCreateException { if (INSTANCE == null) { - IContainerFactory factory = ContainerFactory.getDefault(); - List list = factory.getDescriptions(); - for (Iterator itr = list.iterator(); itr.hasNext();) { - ContainerTypeDescription ctd = (ContainerTypeDescription) itr.next(); - String name = ctd.getName(); + final IContainerFactory factory = ContainerFactory.getDefault(); + final List list = factory.getDescriptions(); + for (final Iterator itr = list.iterator(); itr.hasNext();) { + final ContainerTypeDescription ctd = (ContainerTypeDescription) itr.next(); + final String name = ctd.getName(); if (name.equals(containerName)) { - IContainer createContainer = factory.createContainer(ctd.getName()); + final IContainer createContainer = factory.createContainer(ctd.getName()); INSTANCE = new SingletonDiscoveryContainer(createContainer); return INSTANCE; } @@ -46,9 +46,9 @@ public class SingletonDiscoveryContainerInstantiator implements IContainerInstan /* (non-Javadoc) * @see org.eclipse.ecf.core.provider.IContainerInstantiator#createInstance(org.eclipse.ecf.core.ContainerTypeDescription, java.lang.Object[]) */ - public IContainer createInstance(ContainerTypeDescription description, Object[] parameters) throws ContainerCreateException { + public IContainer createInstance(final ContainerTypeDescription description, final Object[] parameters) throws ContainerCreateException { if (parameters != null && parameters.length == 1 && parameters[0] instanceof String) { - String containerName = (String) parameters[0]; + final String containerName = (String) parameters[0]; return getInstance(containerName); } throw new ContainerCreateException("Missing parameter"); //$NON-NLS-1$ @@ -57,17 +57,20 @@ public class SingletonDiscoveryContainerInstantiator implements IContainerInstan /* (non-Javadoc) * @see org.eclipse.ecf.core.provider.IContainerInstantiator#getSupportedAdapterTypes(org.eclipse.ecf.core.ContainerTypeDescription) */ - public String[] getSupportedAdapterTypes(ContainerTypeDescription description) { + public String[] getSupportedAdapterTypes(final ContainerTypeDescription description) { return new String[] {IDiscoveryContainerAdapter.class.getName()}; } /* (non-Javadoc) * @see org.eclipse.ecf.core.provider.IContainerInstantiator#getSupportedParameterTypes(org.eclipse.ecf.core.ContainerTypeDescription) */ - public Class[][] getSupportedParameterTypes(ContainerTypeDescription description) { + public Class[][] getSupportedParameterTypes(final ContainerTypeDescription description) { return new Class[][] {{String.class}}; } + /* (non-Javadoc) + * @see org.eclipse.ecf.core.provider.IContainerInstantiator#getSupportedIntents(org.eclipse.ecf.core.ContainerTypeDescription) + */ public String[] getSupportedIntents(ContainerTypeDescription description) { return null; } |