Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 864d1c3c3cd8df4e3a2692faf8776e05 > files > 1086

db4o-doc-7.4-2.fc13.i686.rpm

<html>
  <head>
    <META http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Connecting To Db4o</title>
    <link rel="stylesheet" type="text/css" href="../../../../style.css">
  </head>
  <body>
    <div class="CommonContent">
      <div class="CommonContentArea">
        <h1>Connecting To Db4o</h1><script>
//We attach this function to a browser object as a variable so that if multiple of these blocks are
//present on the same page, then they will simply over-write eachother with the same function instead
//of generating a naming collision.
window.WikiCodeFormattingCopyToClipboard = function copyToClipboard(sID){
	var sContent = document.getElementById(sID).innerText;
	if( window.clipboardData && clipboardData.setData )
	{
		clipboardData.setData("Text", sContent);
	}
	else
	{
		alert("You must enable javascript access to your clipboard for this feature to work. Please referr to your browser documentation or Google search for instructions.");
	}
}
</script><p><font color="#990000">This topic applies to Java version only.</font>&nbsp;&nbsp;</p><p>The only thing left - is a
connection to the db4o_osgi plug-in. It can be established upon the plug-in
start and terminated upon the plug-in stop:</p>

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">Activator.java: <span class="fscMemberName">start</span></span></div><div class="fscCode"><pre ID="....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Start_247_68"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">01</span><img id="....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Start_247_68_0_190_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Start_247_68_0_190_Open_Text').style.display='none'; document.getElementById('....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Start_247_68_0_190_Closed_Image').style.display='inline'; document.getElementById('....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Start_247_68_0_190_Closed_Text').style.display='inline';"/><img id="....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Start_247_68_0_190_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Start_247_68_0_190_Closed_Text').style.display='none'; document.getElementById('....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Start_247_68_0_190_Open_Image').style.display='inline'; document.getElementById('....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Start_247_68_0_190_Open_Text').style.display='inline';"/><span id="....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Start_247_68_0_190_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">/**/</span><span id="....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Start_247_68_0_190_Open_Text"><span style="color: #008000;">/*</span><span style="color: #008000;">
</span><span style="color: #008080;">02</span><span style="color: #008000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>   * (non-Javadoc)
</span><span style="color: #008080;">03</span><span style="color: #008000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>   * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
</span><span style="color: #008080;">04</span><span style="color: #008000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>   * Obtains a db4o_osgi service reference and registers it with Db4oProvider
</span><span style="color: #008080;">05</span><span style="color: #008000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>   </span><span style="color: #008000;">*/</span></span><span style="color: #000000;">
</span><span style="color: #008080;">06</span><span style="color: #000000;"><img id="....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Start_247_68_250_481_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Start_247_68_250_481_Open_Text').style.display='none'; document.getElementById('....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Start_247_68_250_481_Closed_Image').style.display='inline'; document.getElementById('....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Start_247_68_250_481_Closed_Text').style.display='inline';"/><img id="....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Start_247_68_250_481_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Start_247_68_250_481_Closed_Text').style.display='none'; document.getElementById('....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Start_247_68_250_481_Open_Image').style.display='inline'; document.getElementById('....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Start_247_68_250_481_Open_Text').style.display='inline';"/>  </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> start(BundleContext context) </span><span style="color: #0000FF;">throws</span><span style="color: #000000;"> Exception </span><span id="....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Start_247_68_250_481_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Start_247_68_250_481_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">07</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>    </span><span style="color: #0000FF;">super</span><span style="color: #000000;">.start(context);
</span><span style="color: #008080;">08</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>    ServiceReference serviceRef </span><span style="color: #000000;">=</span><span style="color: #000000;"> context.getServiceReference(Db4oService.</span><span style="color: #0000FF;">class</span><span style="color: #000000;">.getName());
</span><span style="color: #008080;">09</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>    Db4oService db4oService </span><span style="color: #000000;">=</span><span style="color: #000000;"> (Db4oService)context.getService(serviceRef);
</span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>    Db4oProvider.Initialize(db4oService);
</span><span style="color: #008080;">11</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>  }</span></span></div></pre></div></div>

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">Activator.java: <span class="fscMemberName">stop</span></span></div><div class="fscCode"><pre ID="....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Stop_319_67"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">01</span><img id="....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Stop_319_67_0_168_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Stop_319_67_0_168_Open_Text').style.display='none'; document.getElementById('....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Stop_319_67_0_168_Closed_Image').style.display='inline'; document.getElementById('....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Stop_319_67_0_168_Closed_Text').style.display='inline';"/><img id="....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Stop_319_67_0_168_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Stop_319_67_0_168_Closed_Text').style.display='none'; document.getElementById('....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Stop_319_67_0_168_Open_Image').style.display='inline'; document.getElementById('....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Stop_319_67_0_168_Open_Text').style.display='inline';"/><span id="....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Stop_319_67_0_168_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">/**/</span><span id="....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Stop_319_67_0_168_Open_Text"><span style="color: #008000;">/*</span><span style="color: #008000;">
</span><span style="color: #008080;">02</span><span style="color: #008000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>   * (non-Javadoc)
</span><span style="color: #008080;">03</span><span style="color: #008000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>   * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
</span><span style="color: #008080;">04</span><span style="color: #008000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>   * Unregisters the db4o_osgi service from Db4oProvider
</span><span style="color: #008080;">05</span><span style="color: #008000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>   </span><span style="color: #008000;">*/</span></span><span style="color: #000000;">
</span><span style="color: #008080;">06</span><span style="color: #000000;"><img id="....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Stop_319_67_227_302_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Stop_319_67_227_302_Open_Text').style.display='none'; document.getElementById('....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Stop_319_67_227_302_Closed_Image').style.display='inline'; document.getElementById('....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Stop_319_67_227_302_Closed_Text').style.display='inline';"/><img id="....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Stop_319_67_227_302_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Stop_319_67_227_302_Closed_Text').style.display='none'; document.getElementById('....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Stop_319_67_227_302_Open_Image').style.display='inline'; document.getElementById('....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Stop_319_67_227_302_Open_Text').style.display='inline';"/>  </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> stop(BundleContext context) </span><span style="color: #0000FF;">throws</span><span style="color: #000000;"> Exception </span><span id="....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Stop_319_67_227_302_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="....OsgiJava.ZipssrcmemopluginActivator.Java_SrcmemopluginActivator.Java_Stop_319_67_227_302_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">07</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>    Db4oProvider.UnInitialize();
</span><span style="color: #008080;">08</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>    plugin </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;">;
</span><span style="color: #008080;">09</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>    </span><span style="color: #0000FF;">super</span><span style="color: #000000;">.stop(context);
</span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>  }</span></span></div></pre></div></div>



</div>
    </div>
    <div id="footer">
					This revision (1) was last Modified 2007-07-29T14:38:30 by Tetyana.
				</div>
  </body>
</html>