<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://wiki.transcends.co/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.transcends.co/index.php?action=history&amp;feed=atom&amp;title=Database_Tutorial_Command_Provider</id>
		<title>Database Tutorial Command Provider - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.transcends.co/index.php?action=history&amp;feed=atom&amp;title=Database_Tutorial_Command_Provider"/>
		<link rel="alternate" type="text/html" href="https://wiki.transcends.co/index.php?title=Database_Tutorial_Command_Provider&amp;action=history"/>
		<updated>2026-06-03T19:43:55Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.1</generator>

	<entry>
		<id>https://wiki.transcends.co/index.php?title=Database_Tutorial_Command_Provider&amp;diff=2675&amp;oldid=prev</id>
		<title>Kyle: /* Extra Credit */</title>
		<link rel="alternate" type="text/html" href="https://wiki.transcends.co/index.php?title=Database_Tutorial_Command_Provider&amp;diff=2675&amp;oldid=prev"/>
				<updated>2009-12-03T22:27:01Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Extra Credit&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 22:27, 3 December 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 40:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 40:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=Extra Credit=&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=Extra Credit=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Here are some extra things that could be added to this class to extend functionality.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==A command that lists the last five tag reads==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==A command that lists the last five tag reads==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Right now the console only allows you to start and stop the application. However, it could provide richer functionality. For example, suppose you wrote a method like this:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;pre&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;public Object _lastFiveTagReads(CommandInterpreter intp)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/pre&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;This method might print out the last five tag reads seen by the reader. &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Control the DBApp with RMI instead of the console==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Control the DBApp with RMI instead of the console==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;The Eclipse Console is one way to control the DB Application, but it has its pitfalls. For example, if the edge server is started up as a background service, you won't have access to the console. In this case, you may want a more robust way to control the application. You could do this any number of ways, one of which would be to use RMI (Remote Method Invocation). This would allow clients in the network to issue commands to your application.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Kyle</name></author>	</entry>

	<entry>
		<id>https://wiki.transcends.co/index.php?title=Database_Tutorial_Command_Provider&amp;diff=2666&amp;oldid=prev</id>
		<title>Kyle: New page: In order to control the database application, you can use a CommandProvider, which is a class that plugs into the eclipse osgi console and allows you to provide custom commands. =Implement...</title>
		<link rel="alternate" type="text/html" href="https://wiki.transcends.co/index.php?title=Database_Tutorial_Command_Provider&amp;diff=2666&amp;oldid=prev"/>
				<updated>2009-12-03T21:50:48Z</updated>
		
		<summary type="html">&lt;p&gt;New page: In order to control the database application, you can use a CommandProvider, which is a class that plugs into the eclipse osgi console and allows you to provide custom commands. =Implement...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;In order to control the database application, you can use a CommandProvider, which is a class that plugs into the eclipse osgi console and allows you to provide custom commands.&lt;br /&gt;
=Implement the CommandProvider interface=&lt;br /&gt;
The org.eclipse.osgi.framework.console.CommandProvider interface allows you to write methods which are exposed as commands in the eclipse console. By convention, any methods that you want to expose should start with an underscore (i.e. '_'), should have a return type of Object and should take in a CommandInterpreter (which allows you to get input and write output to the eclipse console ).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	/**&lt;br /&gt;
	 * Start the application&lt;br /&gt;
	 * &lt;br /&gt;
	 * @param intp&lt;br /&gt;
	 * @return&lt;br /&gt;
	 */&lt;br /&gt;
	public Object _dbstart(CommandInterpreter intp) {&lt;br /&gt;
		app.start();&lt;br /&gt;
		return null;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Stop the application&lt;br /&gt;
	 * &lt;br /&gt;
	 * @param intp&lt;br /&gt;
	 * @return&lt;br /&gt;
	 */&lt;br /&gt;
	public Object _dbstop(CommandInterpreter intp) {&lt;br /&gt;
		app.stop();&lt;br /&gt;
		return null;&lt;br /&gt;
	}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Dependency Injection==&lt;br /&gt;
Like the other objects we have create so far, we are going to use dependency injection to give the CommandProvider access to the DBApp object.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	/**&lt;br /&gt;
	 * Called by spring&lt;br /&gt;
	 * &lt;br /&gt;
	 * @param app&lt;br /&gt;
	 *            the app to set&lt;br /&gt;
	 */&lt;br /&gt;
	public void setApp(DBApp app) {&lt;br /&gt;
		this.app = app;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=Extra Credit=&lt;br /&gt;
==A command that lists the last five tag reads==&lt;br /&gt;
==Control the DBApp with RMI instead of the console==&lt;/div&gt;</summary>
		<author><name>Kyle</name></author>	</entry>

	</feed>