|
Re: extension to EP org.eclipse.ecf.containerFactory [message #607484 is a reply to message #607482] |
Sat, 29 July 2006 23:21 |
Scott Lewis Messages: 1038 Registered: July 2009 |
Senior Member |
|
|
Hi Ilaria,
Ilaria Manno wrote:
> Hi,
> we are implementing an application using the Container provided by
> org.eclipse.ecf.provider.
> The application doesn't work without an extension to the extension-point
> org.eclipse.ecf.containerFactory (as in
> org.eclipse.ecf.example.collab).
>
> The description of the extension-point says " This extension allows
> plugins to register themselves as 'providers' of ECF
> containers...", but we are not providing a container, we are using the
> container provided by org.eclipse.ecf.provider.
If all you want to do is use the generic container
(TCPClientSOContainer) then the solution you describe of moving the
containerFactory declaration to the org.eclipse.ecf.provider plugin is
OK. Actually, as I say below I think it's declaration in
org.eclipse.ecf.example.collab may have just been a mistake.
BUT if you need/want to override methods on TCPClientSOContainer or
super classes (ClientSOContainer and SOContainer) to customize the
behavior of the container, then it would make the most sense to define a
(perhaps trivial) new subclass..e.g.
public class MyGenericContainer extends TCPClientSOContainer {
public MyGenericContainer() { ... }
public void methodToOverride(...) { ... }
}
}
Then, you can define a new IContainerInstantiator implementor to return
an instance of your subclass...e.g.:
public MyContainerInstantiator implements IContainerInstantiator {
....
public IContainer createInstance(
ContainerTypeDescription description, Class[] argTypes,
Object[] args) throws ContainerInstantiationException {
....
return new MyGenericContainer();
}
}
then, you can declare in your plugin.xml an extension of the
containerFactory extension point and define your MyContainerInstantiator
as the class for the factory...e.g:
<extension
point="org.eclipse.ecf.containerFactory">
<containerFactory
class="org.whatever.mygeneric.MyContainerInstantiator"
name="my.generic.client"/>
</extension>
And then you would get a MyGenericContainer via the following call:
IContainer container =
ContainerFactory.getDefault().createContainer("my.generic.client ");
}> So, we have "moved" the extension from our plug-in to
> org.eclipse.ecf.provider, but we would ask you if it is the same, and
> why you have preferred to add the extension in org.eclipse.ecf.collab
> (that also uses the container provided
> org.eclipse.ecf.provider) instead of in org.eclipse.ecf.provider.
It was in org.eclipse.ecf.provider originally. I think it was moved to
collab accidently, actually. At some point in the near future, I will
fix this and move it's declaration back to org.eclipse.ecf.provider.
Thanks for the report. I've filed this as a bug so it doesn't get lost:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=152261
Scott
|
|
|
Powered by
FUDForum. Page generated in 0.02696 seconds