Difference between revisions of "Reader Activator.java"

From RifidiWiki

Jump to: navigation, search
m (Reverted edits by Amesycyxa (Talk); changed back to last version by Jmaine)
 
Line 1: Line 1:
=[http://yhenaju.co.cc Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page]=
 
 
[[category:developerDoc]][[category:emulatorDoc]]
 
[[category:developerDoc]][[category:emulatorDoc]]
 
You should only modify Activator.java that was automatically created to create and register the reader--like this (Example taken from ThingMagic Reader):
 
You should only modify Activator.java that was automatically created to create and register the reader--like this (Example taken from ThingMagic Reader):
<pre><nowiki>
+
<pre><nowiki>
 
public class Activator implements BundleActivator  {
 
public class Activator implements BundleActivator  {
  
Line 11: Line 10:
 
*/
 
*/
 
public void start(BundleContext context) throws Exception {
 
public void start(BundleContext context) throws Exception {
System.out.println(&quot;Registered org.rifidi.emulator.reader.thingmagic&quot;);
+
System.out.println("Registered org.rifidi.emulator.reader.thingmagic");
 
context.registerService(new String[]{ReaderModule.class.getName()}, new ThingMagicReaderModule(), new Hashtable());
 
context.registerService(new String[]{ReaderModule.class.getName()}, new ThingMagicReaderModule(), new Hashtable());
 
}
 
}
Line 20: Line 19:
 
*/
 
*/
 
public void stop(BundleContext context) throws Exception {
 
public void stop(BundleContext context) throws Exception {
System.out.println(&quot;Shutting down org.rifidi.emulator.reader.thingmagic&quot;);
+
System.out.println("Shutting down org.rifidi.emulator.reader.thingmagic");
 
}
 
}
  
  
 
}
 
}
&lt;/nowiki&gt;&lt;/pre&gt;
+
</nowiki></pre>
 
Notice those those three total lines of code in the methods '''start''' and '''stop'''. Those are the only lines one has to add then chance '''ThingMagic''' or '''thingmagic''' to match the name of the reader one is building.
 
Notice those those three total lines of code in the methods '''start''' and '''stop'''. Those are the only lines one has to add then chance '''ThingMagic''' or '''thingmagic''' to match the name of the reader one is building.

Latest revision as of 19:41, 26 November 2010

You should only modify Activator.java that was automatically created to create and register the reader--like this (Example taken from ThingMagic Reader):

public class Activator implements BundleActivator  {


	/*
	 * (non-Javadoc)
	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
	 */
	public void start(BundleContext context) throws Exception {
		System.out.println("Registered org.rifidi.emulator.reader.thingmagic");
		context.registerService(new String[]{ReaderModule.class.getName()}, new ThingMagicReaderModule(), new Hashtable());
	}

	/*
	 * (non-Javadoc)
	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
	 */
	public void stop(BundleContext context) throws Exception {
		System.out.println("Shutting down org.rifidi.emulator.reader.thingmagic");
	}


}

Notice those those three total lines of code in the methods start and stop. Those are the only lines one has to add then chance ThingMagic or thingmagic to match the name of the reader one is building.

Personal tools