|
|
Re: Add groups (TCPServerSOContainer) dynamically to TCPServerSOContainerGroup [message #603498 is a reply to message #601572] |
Wed, 12 April 2006 14:14 |
Guy Dierx 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 |
Scott Lewis Messages: 1038 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
>>>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04190 seconds