Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Communications Framework (ECF) » Add groups (TCPServerSOContainer) dynamically to TCPServerSOContainerGroup
Add groups (TCPServerSOContainer) dynamically to TCPServerSOContainerGroup [message #601565] Mon, 10 April 2006 08:20 Go to next message
Guy Dierx is currently offline Guy DierxFriend
Messages: 4
Registered: July 2009
Junior Member
Hello,

I was wondering about dynamically adding groups / TCPServerSOContainer to a
TCPServerSOContainerGroup, similar to adding a IConnectPolicy to a
ISharedObjectContainerGroupManager. Any thoughts about this?

For implementing this idea I was thinking about something like changing the
TCPServerSOContainerGroup.handleAccept(Socket aSocket) method at:

if (srs == null)
throw new InvalidObjectException("Container for target " + path
+ " not found!");

into something like:
if (srs == null) {
// If there is no TCPServerSOContainer, check if we can
create one on the fly.
if (dynamicGroupPolicy != null) {
dynamicGroupPolicy.checkGroup(path);
srs = (TCPServerSOContainer) get(path);
}
if (srs == null) {
throw new InvalidObjectException("Container for
target " + path
+ " not found!");
}
}

The dynamicGroupPolicy is declared in TCPServerSOContainerGroup as:
protected IDynamicGroupPolicy dynamicGroupPolicy;

and the IDynamicGroupPolicy can be set in TCPServerSOContainerGroup using:
public void setDynamicGroupPolicy(IDynamicGroupPolicy
aDynamicGroupPolicy) {
dynamicGroupPolicy = aDynamicGroupPolicy;
}


The IDynamicGroupPolicy is defined as follows and can be extended:

public interface IDynamicGroupPolicy {

public void checkGroup(String groupName);

}

When the extension of IDynamicGroupPolicy is called, it will add a
TCPServerSOContainer to TCPServerSOContainerGroup. Or maybe it is better to
let the checkGroup return a TCPServerSOContainer.

regards,

Guy
Re: Add groups (TCPServerSOContainer) dynamically to TCPServerSOContainerGroup [message #601572 is a reply to message #601565] Tue, 11 April 2006 01:00 Go to previous messageGo to next message
Scott Lewis is currently offline Scott LewisFriend
Messages: 971
Registered: July 2009
Senior Member
Hi Guy,

Why not just create a class that extends TCPServerSOContainerGroup and
implement a method on that class that overrides handleAccept(Socket) to
do what you want? Or maybe even better...just override
TCPServerSOContainerGroup.get(String) to do what you want.

I suppose I don't yet see the use in having a new interface (like
IDynamicGroupPolicy) because currently *none* of the 'container group'
semantics are exposed via the org.eclipse.ecf.core API anyway (i.e. you
are still dealing directly with the TCPServerSOContainerGroup class to
do these things. This too, could be changed...and might be a good idea
(any thoughts from others on whether 'container groups' should be
exposed at the API level for servers?) but it's not obvious to me right
now that it's necessary or even desired.

Anyway, let me know what you think.

Scott


Guy wrote:
> Hello,
>
> I was wondering about dynamically adding groups / TCPServerSOContainer to a
> TCPServerSOContainerGroup, similar to adding a IConnectPolicy to a
> ISharedObjectContainerGroupManager. Any thoughts about this?
>
> For implementing this idea I was thinking about something like changing the
> TCPServerSOContainerGroup.handleAccept(Socket aSocket) method at:
>
> if (srs == null)
> throw new InvalidObjectException("Container for target " + path
> + " not found!");
>
> into something like:
> if (srs == null) {
> // If there is no TCPServerSOContainer, check if we can
> create one on the fly.
> if (dynamicGroupPolicy != null) {
> dynamicGroupPolicy.checkGroup(path);
> srs = (TCPServerSOContainer) get(path);
> }
> if (srs == null) {
> throw new InvalidObjectException("Container for
> target " + path
> + " not found!");
> }
> }
>
> The dynamicGroupPolicy is declared in TCPServerSOContainerGroup as:
> protected IDynamicGroupPolicy dynamicGroupPolicy;
>
> and the IDynamicGroupPolicy can be set in TCPServerSOContainerGroup using:
> public void setDynamicGroupPolicy(IDynamicGroupPolicy
> aDynamicGroupPolicy) {
> dynamicGroupPolicy = aDynamicGroupPolicy;
> }
>
>
> The IDynamicGroupPolicy is defined as follows and can be extended:
>
> public interface IDynamicGroupPolicy {
>
> public void checkGroup(String groupName);
>
> }
>
> When the extension of IDynamicGroupPolicy is called, it will add a
> TCPServerSOContainer to TCPServerSOContainerGroup. Or maybe it is better to
> let the checkGroup return a TCPServerSOContainer.
>
> regards,
>
> Guy
>
Re: Add groups (TCPServerSOContainer) dynamically to TCPServerSOContainerGroup [message #603498 is a reply to message #601572] Wed, 12 April 2006 14:14 Go to previous messageGo to next message
Guy Dierx is currently offline Guy DierxFriend
Messages: 4
Registered: July 2009
Junior Member
Hello Scott,

I did indeed extended TCPServerSOContainerGroup and this works fine for me,
no problem there. I was only wondering if more people could use the
functionality of dynamically adding groups to a server. Of course, if you
want to add this functionality, you should do it according to the ECF
architecture.

thx,
Guy

> Hi Guy,
>
> Why not just create a class that extends TCPServerSOContainerGroup and
> implement a method on that class that overrides handleAccept(Socket) to
> do what you want? Or maybe even better...just override
> TCPServerSOContainerGroup.get(String) to do what you want.
>
> I suppose I don't yet see the use in having a new interface (like
> IDynamicGroupPolicy) because currently *none* of the 'container group'
> semantics are exposed via the org.eclipse.ecf.core API anyway (i.e. you
> are still dealing directly with the TCPServerSOContainerGroup class to
> do these things. This too, could be changed...and might be a good idea
> (any thoughts from others on whether 'container groups' should be
> exposed at the API level for servers?) but it's not obvious to me right
> now that it's necessary or even desired.
>
> Anyway, let me know what you think.
>
> Scott
>
>
> Guy wrote:
>> Hello,
>>
>> I was wondering about dynamically adding groups / TCPServerSOContainer to
>> a TCPServerSOContainerGroup, similar to adding a IConnectPolicy to a
>> ISharedObjectContainerGroupManager. Any thoughts about this?
>>
>> For implementing this idea I was thinking about something like changing
>> the TCPServerSOContainerGroup.handleAccept(Socket aSocket) method at:
>>
>> if (srs == null)
>> throw new InvalidObjectException("Container for target " +
>> path
>> + " not found!");
>>
>> into something like:
>> if (srs == null) {
>> // If there is no TCPServerSOContainer, check if we can
>> create one on the fly.
>> if (dynamicGroupPolicy != null) {
>> dynamicGroupPolicy.checkGroup(path);
>> srs = (TCPServerSOContainer) get(path);
>> }
>> if (srs == null) {
>> throw new InvalidObjectException("Container for
>> target " + path
>> + " not found!");
>> }
>> }
>>
>> The dynamicGroupPolicy is declared in TCPServerSOContainerGroup as:
>> protected IDynamicGroupPolicy dynamicGroupPolicy;
>>
>> and the IDynamicGroupPolicy can be set in TCPServerSOContainerGroup
>> using:
>> public void setDynamicGroupPolicy(IDynamicGroupPolicy
>> aDynamicGroupPolicy) {
>> dynamicGroupPolicy = aDynamicGroupPolicy;
>> }
>>
>>
>> The IDynamicGroupPolicy is defined as follows and can be extended:
>>
>> public interface IDynamicGroupPolicy {
>>
>> public void checkGroup(String groupName);
>>
>> }
>>
>> When the extension of IDynamicGroupPolicy is called, it will add a
>> TCPServerSOContainer to TCPServerSOContainerGroup. Or maybe it is better
>> to let the checkGroup return a TCPServerSOContainer.
>>
>> regards,
>>
>> Guy
>>
Re: Add groups (TCPServerSOContainer) dynamically to TCPServerSOContainerGroup [message #603501 is a reply to message #603498] Thu, 13 April 2006 01:17 Go to previous message
Scott Lewis is currently offline Scott LewisFriend
Messages: 971
Registered: July 2009
Senior Member
Hi Guy,

It might very well be a good idea to expose a 'container group'
api...especially since we are planning work on ECF servers as an
important sub-project of ECF...i.e.

http://wiki.eclipse.org/index.php/Eclipse_Communication_Fram ework_Project

(will be working on this over next weeks...*please* if people have
comments relevant to 'ECF for servers' or other project plans then
communicate them publicly...i..e on this newsgroup or to
ecf-dev@eclipse.org OR file an enhancement bug report at
http://bugs.eclipse.org (under ECF project of course).

Thanks Guy. I might want to engage you in further discussion and design
about server APIs (e.g. container group)...and maybe even get you to
contribute further.

Scott


Guy wrote:
> Hello Scott,
>
> I did indeed extended TCPServerSOContainerGroup and this works fine for me,
> no problem there. I was only wondering if more people could use the
> functionality of dynamically adding groups to a server. Of course, if you
> want to add this functionality, you should do it according to the ECF
> architecture.
>
> thx,
> Guy
>
>> Hi Guy,
>>
>> Why not just create a class that extends TCPServerSOContainerGroup and
>> implement a method on that class that overrides handleAccept(Socket) to
>> do what you want? Or maybe even better...just override
>> TCPServerSOContainerGroup.get(String) to do what you want.
>>
>> I suppose I don't yet see the use in having a new interface (like
>> IDynamicGroupPolicy) because currently *none* of the 'container group'
>> semantics are exposed via the org.eclipse.ecf.core API anyway (i.e. you
>> are still dealing directly with the TCPServerSOContainerGroup class to
>> do these things. This too, could be changed...and might be a good idea
>> (any thoughts from others on whether 'container groups' should be
>> exposed at the API level for servers?) but it's not obvious to me right
>> now that it's necessary or even desired.
>>
>> Anyway, let me know what you think.
>>
>> Scott
>>
>>
>> Guy wrote:
>>> Hello,
>>>
>>> I was wondering about dynamically adding groups / TCPServerSOContainer to
>>> a TCPServerSOContainerGroup, similar to adding a IConnectPolicy to a
>>> ISharedObjectContainerGroupManager. Any thoughts about this?
>>>
>>> For implementing this idea I was thinking about something like changing
>>> the TCPServerSOContainerGroup.handleAccept(Socket aSocket) method at:
>>>
>>> if (srs == null)
>>> throw new InvalidObjectException("Container for target " +
>>> path
>>> + " not found!");
>>>
>>> into something like:
>>> if (srs == null) {
>>> // If there is no TCPServerSOContainer, check if we can
>>> create one on the fly.
>>> if (dynamicGroupPolicy != null) {
>>> dynamicGroupPolicy.checkGroup(path);
>>> srs = (TCPServerSOContainer) get(path);
>>> }
>>> if (srs == null) {
>>> throw new InvalidObjectException("Container for
>>> target " + path
>>> + " not found!");
>>> }
>>> }
>>>
>>> The dynamicGroupPolicy is declared in TCPServerSOContainerGroup as:
>>> protected IDynamicGroupPolicy dynamicGroupPolicy;
>>>
>>> and the IDynamicGroupPolicy can be set in TCPServerSOContainerGroup
>>> using:
>>> public void setDynamicGroupPolicy(IDynamicGroupPolicy
>>> aDynamicGroupPolicy) {
>>> dynamicGroupPolicy = aDynamicGroupPolicy;
>>> }
>>>
>>>
>>> The IDynamicGroupPolicy is defined as follows and can be extended:
>>>
>>> public interface IDynamicGroupPolicy {
>>>
>>> public void checkGroup(String groupName);
>>>
>>> }
>>>
>>> When the extension of IDynamicGroupPolicy is called, it will add a
>>> TCPServerSOContainer to TCPServerSOContainerGroup. Or maybe it is better
>>> to let the checkGroup return a TCPServerSOContainer.
>>>
>>> regards,
>>>
>>> Guy
>>>
>
Previous Topic:Weird ECF usage
Next Topic:ECF and JGroups
Goto Forum:
  


Current Time: Fri Nov 21 16:54:20 GMT 2014

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

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