Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Setting timeout
[CDO] Setting timeout [message #426716] Mon, 19 January 2009 14:56 Go to next message
J F is currently offline J FFriend
Messages: 256
Registered: July 2009
Senior Member
i'm sure Eike answered this somewhere else but...

I'm moving my code from CDO 1.0 to CDO 2.0, I even tried a port to the
head of the CVS workspace.

I need to be able to set the timout for debugging and runtime tests
differently. I used to set it on failover strategy by using a Null
strategy and adding the appropriate method, then as the API evolved I set
in on protocol.

At the momment I am getting the session from the PluginContainer as I use
the CDO GUI to diagnose a resticted Repository exploring UI I intend for
End Users;

String productGroup = CDOSessionFactory.PRODUCT_GROUP;
String type = CDOProtocolConstants.PROTOCOL_NAME;
if(session != null)
{
session.close();
}
session = (CDOSession)
IPluginContainer.INSTANCE.getElement(productGroup,
type,
getServerDescription());

What is the proper way to set the timeout on the protocol so that I can
set how long to wait for a response (indication) to a request?

Thanks
Re: [CDO] Setting timeout [message #426717 is a reply to message #426716] Mon, 19 January 2009 15:34 Go to previous messageGo to next message
Victor Roldan Betancort is currently offline Victor Roldan BetancortFriend
Messages: 524
Registered: July 2009
Senior Member
Hi JF,

you could do the following:

session.getProtocol().setTimeout(long);

Now everything related with protocol is a ISignalProtocol.

HTH,
ViK.

JF escribió:
> i'm sure Eike answered this somewhere else but...
>
> I'm moving my code from CDO 1.0 to CDO 2.0, I even tried a port to the
> head of the CVS workspace.
> I need to be able to set the timout for debugging and runtime tests
> differently. I used to set it on failover strategy by using a Null
> strategy and adding the appropriate method, then as the API evolved I
> set in on protocol.
> At the momment I am getting the session from the PluginContainer as I
> use the CDO GUI to diagnose a resticted Repository exploring UI I intend
> for End Users;
>
> String productGroup = CDOSessionFactory.PRODUCT_GROUP;
> String type = CDOProtocolConstants.PROTOCOL_NAME;
> if(session != null)
> {
> session.close();
> }
> session = (CDOSession)
> IPluginContainer.INSTANCE.getElement(productGroup,
> type,
> getServerDescription());
>
> What is the proper way to set the timeout on the protocol so that I can
> set how long to wait for a response (indication) to a request?
>
> Thanks
>
Re: [CDO] Setting timeout [message #426719 is a reply to message #426717] Mon, 19 January 2009 15:38 Go to previous messageGo to next message
J F is currently offline J FFriend
Messages: 256
Registered: July 2009
Senior Member
Thanks Vik,

I am using the HEAD CVS workspace sources for CDO, getProtocol seems to
have disappeared from CDOSession? I wondered what I should be doing in the
future...
Re: [CDO] Setting timeout [message #426720 is a reply to message #426719] Mon, 19 January 2009 16:01 Go to previous messageGo to next message
Victor Roldan Betancort is currently offline Victor Roldan BetancortFriend
Messages: 524
Registered: July 2009
Senior Member
JK,

sorry, I wrote too fast!

Notice that there are not 2 CDOSession interfaces:

org.eclipse.emf.cdo.net4j.CDOSession
org.eclipse.emf.cdo.session.CDOSession

Eike di recently some work to make CDO API independent from NET4J.

if you look at:

org.eclipse.emf.cdo.net4j.CDOSession.options().

You will see that there is "getProtocol()" method.

I guess it's a matter of casting your
org.eclipse.emf.cdo.session.CDOSession to
org.eclipse.emf.cdo.net4j.CDOSession and accessing options().


so you'll access this way:
((org.eclipse.emf.cdo.net4j.CDOSession)session).options().ge tProtocol().setTimeout(long);


Hope this works for you this time!

JF escribió:
> Thanks Vik,
>
> I am using the HEAD CVS workspace sources for CDO, getProtocol seems to
> have disappeared from CDOSession? I wondered what I should be doing in
> the future...
>
Re: [CDO] Setting timeout [message #426766 is a reply to message #426720] Tue, 20 January 2009 08:50 Go to previous message
J F is currently offline J FFriend
Messages: 256
Registered: July 2009
Senior Member
Sorry to clog up the newsgroup, but thanks... :-)
Previous Topic:Is there an example/whitepaper of custom proxy resolution.
Next Topic:e[All]Contents
Goto Forum:
  


Current Time: Thu Apr 25 20:37:52 GMT 2024

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

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

Back to the top