diff options
Diffstat (limited to 'examples/org.eclipse.tm.tcf.examples.daytime/src/org/eclipse/tm/internal/tcf/examples/daytime/DaytimeServiceProxy.java')
-rw-r--r-- | examples/org.eclipse.tm.tcf.examples.daytime/src/org/eclipse/tm/internal/tcf/examples/daytime/DaytimeServiceProxy.java | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/examples/org.eclipse.tm.tcf.examples.daytime/src/org/eclipse/tm/internal/tcf/examples/daytime/DaytimeServiceProxy.java b/examples/org.eclipse.tm.tcf.examples.daytime/src/org/eclipse/tm/internal/tcf/examples/daytime/DaytimeServiceProxy.java index c1d62dea8..4270aee4d 100644 --- a/examples/org.eclipse.tm.tcf.examples.daytime/src/org/eclipse/tm/internal/tcf/examples/daytime/DaytimeServiceProxy.java +++ b/examples/org.eclipse.tm.tcf.examples.daytime/src/org/eclipse/tm/internal/tcf/examples/daytime/DaytimeServiceProxy.java @@ -19,57 +19,57 @@ import org.eclipse.tm.tcf.protocol.Protocol; public class DaytimeServiceProxy implements IDaytimeService { - private final IChannel channel; + private final IChannel channel; - DaytimeServiceProxy(IChannel channel) { - this.channel = channel; - } + DaytimeServiceProxy(IChannel channel) { + this.channel = channel; + } - /** - * Return service name, as it appears on the wire - a TCF name of the service. - */ - public String getName() { - return NAME; - } + /** + * Return service name, as it appears on the wire - a TCF name of the service. + */ + public String getName() { + return NAME; + } - /** - * The method translates arguments to JSON string and sends the command message - * to remote server. When response arrives, it is translated from JSON to - * Java object, which are used to call call-back object. - * - * The translation (marshaling) is done by using utility class Command. - */ - public IToken getTimeOfDay(String tz, final DoneGetTimeOfDay done) { - return new Command(channel, this, "getTimeOfDay", new Object[]{ tz }) { - @Override - public void done(Exception error, Object[] args) { - String str = null; - if (error == null) { - assert args.length == 3; - error = toError(args[0], args[1]); - str = (String)args[2]; - } - done.doneGetTimeOfDay(token, error, str); - } - }.token; - } + /** + * The method translates arguments to JSON string and sends the command message + * to remote server. When response arrives, it is translated from JSON to + * Java object, which are used to call call-back object. + * + * The translation (marshaling) is done by using utility class Command. + */ + public IToken getTimeOfDay(String tz, final DoneGetTimeOfDay done) { + return new Command(channel, this, "getTimeOfDay", new Object[]{ tz }) { + @Override + public void done(Exception error, Object[] args) { + String str = null; + if (error == null) { + assert args.length == 3; + error = toError(args[0], args[1]); + str = (String)args[2]; + } + done.doneGetTimeOfDay(token, error, str); + } + }.token; + } - static { - /* - * Make Daytime Service proxy available to all potential clients by creating - * the proxy object every time a TCF communication channel is opened. - * Note: extension point "org.eclipse.tm.tcf.startup" is used to load this class - * at TCF startup time, so proxy factory is properly activated even if nobody - * import directly from this plugin. - */ - Protocol.addChannelOpenListener(new Protocol.ChannelOpenListener() { + static { + /* + * Make Daytime Service proxy available to all potential clients by creating + * the proxy object every time a TCF communication channel is opened. + * Note: extension point "org.eclipse.tm.tcf.startup" is used to load this class + * at TCF startup time, so proxy factory is properly activated even if nobody + * import directly from this plugin. + */ + Protocol.addChannelOpenListener(new Protocol.ChannelOpenListener() { - public void onChannelOpen(IChannel channel) { - // Check if remote server provides Daytime service - if (channel.getRemoteService(IDaytimeService.NAME) == null) return; - // Create service proxy - channel.setServiceProxy(IDaytimeService.class, new DaytimeServiceProxy(channel)); - } - }); - } + public void onChannelOpen(IChannel channel) { + // Check if remote server provides Daytime service + if (channel.getRemoteService(IDaytimeService.NAME) == null) return; + // Create service proxy + channel.setServiceProxy(IDaytimeService.class, new DaytimeServiceProxy(channel)); + } + }); + } } |