Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse Communications Framework (ECF) » how to pass parameters to IContainer.connect?
how to pass parameters to IContainer.connect? [message #618888] Mon, 30 July 2007 18:55 Go to next message
Eclipse UserFriend
Originally posted by: tonyhsu.tw.ibm.com

Hi,
What's a better way to pass parameters from a consumer who calls
IContainer.connect() to ECF protocol provider? One is from ID and the
other is from IConnectContext.
container.connect(targetID,connectContext);
But ID should be a user related information and connectContext only can
store username and password. Can I use something based on ECF arch. to
pass server related parameters to ECF protocol provider? For example, an
ECF protocol provider doesn't bind to specific server ip and port. How
could I pass these data through container.connect()? Though, I could store
these in a customized ID class technically. Any suggestion?
Re: how to pass parameters to IContainer.connect? [message #618890 is a reply to message #618888] Mon, 30 July 2007 20:23 Go to previous message
Scott Lewis is currently offline Scott LewisFriend
Messages: 1038
Registered: July 2009
Senior Member
Hi Tony,

Tony Hsu wrote:
> Hi,
> What's a better way to pass parameters from a consumer who calls
> IContainer.connect() to ECF protocol provider? One is from ID and the
> other is from IConnectContext.
> container.connect(targetID,connectContext);
> But ID should be a user related information and connectContext only can
> store username and password. Can I use something based on ECF arch. to
> pass server related parameters to ECF protocol provider? For example, an
> ECF protocol provider doesn't bind to specific server ip and port. How
> could I pass these data through container.connect()? Though, I could
> store these in a customized ID class technically. Any suggestion?

Yes. In general, there are three types of information to pass a container:

1) Configuration info (e.g. server port, server comm parameters,
defaults of all kinds)
2) Connect info (e.g. targetID)
3) Authentication info (e.g. IConnectContext)

For 2, as you point out, the way to deal with these is to add a custom
Namespace/ID and pass the info in the ID.

For 3, The ObjectCallback can be used to pass a special/other kind of
object for other authentication information.

Now, for 1, where you need to pass in server configuration information,
and there is no notion of connecting as there is with clients, then you
can pass in provider-specific info as follows:

ContainerTypeDescription description =
ContainerFactory.getDescriptionByName("ecf.your.server");

IContainer container =
ContainerFactory.getDefault().createContainer(description, new Object []
{ your, objects, headed, to, provider });

Then the objects you pass into the Object [] will get passed to your
provider's implementation of the
IContainerInstantiator.createInstance(ContainerTypeDescripti on,Object
[]) as the second parameter. You can use this to create an instance of
your IContainer instance as you need/like.

Does this answer your question?

Scott
Previous Topic:ECF Webinar tomorrow (July 31) at 11am Eastern time
Next Topic:Announcement: ECF 1.0.2 now available
Goto Forum:
  


Current Time: Fri Apr 26 20:29:41 GMT 2024

Powered by FUDForum. Page generated in 0.02368 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top