Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreutarass2008-02-25 18:27:10 -0500
committereutarass2008-02-25 18:27:10 -0500
commit94fbe6cda0f6ddb394b08594e49ffa6de7d87d33 (patch)
treea25f9d8b653234d12553a20bd01eec172a6d844f /examples/org.eclipse.tm.tcf.examples.daytime
parent521178c66ba2989ab837a9d7bb1c4a75216cfde2 (diff)
downloadorg.eclipse.tcf-94fbe6cda0f6ddb394b08594e49ffa6de7d87d33.tar.gz
org.eclipse.tcf-94fbe6cda0f6ddb394b08594e49ffa6de7d87d33.tar.xz
org.eclipse.tcf-94fbe6cda0f6ddb394b08594e49ffa6de7d87d33.zip
Added example agent project: examples/org.eclipse.tm.tcf.examples.daytime.agent.
Renamed agent/memory.[hc] to agent/memoryservice.[hc] to avoid conflict with standard header file.
Diffstat (limited to 'examples/org.eclipse.tm.tcf.examples.daytime')
-rw-r--r--examples/org.eclipse.tm.tcf.examples.daytime/.classpath14
-rw-r--r--examples/org.eclipse.tm.tcf.examples.daytime/.project56
-rw-r--r--examples/org.eclipse.tm.tcf.examples.daytime/build.properties12
-rw-r--r--examples/org.eclipse.tm.tcf.examples.daytime/src/org/eclipse/tm/internal/tcf/examples/daytime/Activator.java98
-rw-r--r--examples/org.eclipse.tm.tcf.examples.daytime/src/org/eclipse/tm/internal/tcf/examples/daytime/DaytimeServiceProxy.java128
-rw-r--r--examples/org.eclipse.tm.tcf.examples.daytime/src/org/eclipse/tm/internal/tcf/examples/daytime/IDaytimeService.java84
6 files changed, 196 insertions, 196 deletions
diff --git a/examples/org.eclipse.tm.tcf.examples.daytime/.classpath b/examples/org.eclipse.tm.tcf.examples.daytime/.classpath
index 021596729..751c8f2e5 100644
--- a/examples/org.eclipse.tm.tcf.examples.daytime/.classpath
+++ b/examples/org.eclipse.tm.tcf.examples.daytime/.classpath
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/examples/org.eclipse.tm.tcf.examples.daytime/.project b/examples/org.eclipse.tm.tcf.examples.daytime/.project
index d9c4d399a..0dbc2599c 100644
--- a/examples/org.eclipse.tm.tcf.examples.daytime/.project
+++ b/examples/org.eclipse.tm.tcf.examples.daytime/.project
@@ -1,28 +1,28 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.tm.tcf.examples.daytime</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.tm.tcf.examples.daytime</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/examples/org.eclipse.tm.tcf.examples.daytime/build.properties b/examples/org.eclipse.tm.tcf.examples.daytime/build.properties
index 2d5759904..786b1df93 100644
--- a/examples/org.eclipse.tm.tcf.examples.daytime/build.properties
+++ b/examples/org.eclipse.tm.tcf.examples.daytime/build.properties
@@ -1,6 +1,6 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.xml,\
- about.html
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ about.html
diff --git a/examples/org.eclipse.tm.tcf.examples.daytime/src/org/eclipse/tm/internal/tcf/examples/daytime/Activator.java b/examples/org.eclipse.tm.tcf.examples.daytime/src/org/eclipse/tm/internal/tcf/examples/daytime/Activator.java
index 1d2b74ae8..6dd916def 100644
--- a/examples/org.eclipse.tm.tcf.examples.daytime/src/org/eclipse/tm/internal/tcf/examples/daytime/Activator.java
+++ b/examples/org.eclipse.tm.tcf.examples.daytime/src/org/eclipse/tm/internal/tcf/examples/daytime/Activator.java
@@ -1,49 +1,49 @@
-package org.eclipse.tm.internal.tcf.examples.daytime;
-
-import org.eclipse.core.runtime.Plugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends Plugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.tm.tcf.examples.daytime";
-
- // The shared instance
- private static Activator plugin;
-
- /**
- * The constructor
- */
- public Activator() {
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
-}
+package org.eclipse.tm.internal.tcf.examples.daytime;
+
+import org.eclipse.core.runtime.Plugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends Plugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.tm.tcf.examples.daytime";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+}
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 066fea0a2..246f832ca 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
@@ -1,64 +1,64 @@
-package org.eclipse.tm.internal.tcf.examples.daytime;
-
-import org.eclipse.tm.tcf.core.Command;
-import org.eclipse.tm.tcf.protocol.IChannel;
-import org.eclipse.tm.tcf.protocol.IToken;
-import org.eclipse.tm.tcf.protocol.Protocol;
-
-
-public class DaytimeServiceProxy implements IDaytimeService {
-
- private final IChannel 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;
- }
-
- /**
- * 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() {
-
- 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));
- }
- });
- }
-}
+package org.eclipse.tm.internal.tcf.examples.daytime;
+
+import org.eclipse.tm.tcf.core.Command;
+import org.eclipse.tm.tcf.protocol.IChannel;
+import org.eclipse.tm.tcf.protocol.IToken;
+import org.eclipse.tm.tcf.protocol.Protocol;
+
+
+public class DaytimeServiceProxy implements IDaytimeService {
+
+ private final IChannel 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;
+ }
+
+ /**
+ * 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() {
+
+ 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));
+ }
+ });
+ }
+}
diff --git a/examples/org.eclipse.tm.tcf.examples.daytime/src/org/eclipse/tm/internal/tcf/examples/daytime/IDaytimeService.java b/examples/org.eclipse.tm.tcf.examples.daytime/src/org/eclipse/tm/internal/tcf/examples/daytime/IDaytimeService.java
index cc8edbb30..cc13f60d9 100644
--- a/examples/org.eclipse.tm.tcf.examples.daytime/src/org/eclipse/tm/internal/tcf/examples/daytime/IDaytimeService.java
+++ b/examples/org.eclipse.tm.tcf.examples.daytime/src/org/eclipse/tm/internal/tcf/examples/daytime/IDaytimeService.java
@@ -1,42 +1,42 @@
-package org.eclipse.tm.internal.tcf.examples.daytime;
-
-import org.eclipse.tm.tcf.protocol.IService;
-import org.eclipse.tm.tcf.protocol.IToken;
-
-/**
- * IDaytimeService allows retrieving the time of day from a remote system.
- */
-public interface IDaytimeService extends IService {
-
- /**
- * This service name, as it appears on the wire - a TCF name of the service.
- */
- public static final String NAME = "Daytime";
-
- /**
- * Retrieve the time of day from remote system.
- * The method sends the command to remote server and returns -
- * it does not wait for the server response. Instead a client should provide
- * a call-back object that will be called when the server answers the command
- * or when the command is aborted by communication error.
- * @param tz - time zone name.
- * @param done - a call-back object.
- * @return a handle for the pending command. The handle can be used to cancel the command,
- * and to match responses to requests - if same call-back object is used for
- * multiple requests.
- */
- IToken getTimeOfDay(String tz, DoneGetTimeOfDay done);
-
- /**
- * Call-back interface for getTimeOfDay() command.
- */
- interface DoneGetTimeOfDay {
- /**
- * This method is called when getTimeOfDay() command is completed.
- * @param token - pending command handle.
- * @param error - null if the command is successful.
- * @param str - a String of the form "01 MAR 2006 11:25:12 CET"
- */
- void doneGetTimeOfDay(IToken token, Exception error, String str);
- }
-}
+package org.eclipse.tm.internal.tcf.examples.daytime;
+
+import org.eclipse.tm.tcf.protocol.IService;
+import org.eclipse.tm.tcf.protocol.IToken;
+
+/**
+ * IDaytimeService allows retrieving the time of day from a remote system.
+ */
+public interface IDaytimeService extends IService {
+
+ /**
+ * This service name, as it appears on the wire - a TCF name of the service.
+ */
+ public static final String NAME = "Daytime";
+
+ /**
+ * Retrieve the time of day from remote system.
+ * The method sends the command to remote server and returns -
+ * it does not wait for the server response. Instead a client should provide
+ * a call-back object that will be called when the server answers the command
+ * or when the command is aborted by communication error.
+ * @param tz - time zone name.
+ * @param done - a call-back object.
+ * @return a handle for the pending command. The handle can be used to cancel the command,
+ * and to match responses to requests - if same call-back object is used for
+ * multiple requests.
+ */
+ IToken getTimeOfDay(String tz, DoneGetTimeOfDay done);
+
+ /**
+ * Call-back interface for getTimeOfDay() command.
+ */
+ interface DoneGetTimeOfDay {
+ /**
+ * This method is called when getTimeOfDay() command is completed.
+ * @param token - pending command handle.
+ * @param error - null if the command is successful.
+ * @param str - a String of the form "01 MAR 2006 11:25:12 CET"
+ */
+ void doneGetTimeOfDay(IToken token, Exception error, String str);
+ }
+}

Back to the top