blob: a03b9afdfec82179309a83f6783394f9bb4e3853 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<head>
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Java Component Loader</TITLE>
<META NAME="GENERATOR" CONTENT="StarOffice/5.2 (Win32)">
<META NAME="CLASSIFICATION" CONTENT="Writing a simple UNO component">
<META NAME="KEYWORDS" CONTENT="UNO,component">
</head>
<body LINK="#444488" VLINK="#444488" BGCOLOR="#eeeeff">
<TABLE WIDTH=100% BORDER=0 CELLPADDING=4 CELLSPACING=0>
<COL WIDTH=75>
<TR>
<TD BGCOLOR="#666699">
<H1 ALIGN=CENTER STYLE="margin-top: 0cm; text-decoration: none"><A HREF="http://www.openoffice.org/"><IMG SRC="../../images/open_office_org_logo.gif" NAME="Grafik1" ALT="OpenOffice" ALIGN=RIGHT WIDTH=109 HEIGHT=54 BORDER=0></A><font color="#ffffff" size="6">Java
Component Loader</font></H1>
</TD>
</TR>
</TABLE>
<HR SIZE=3 noshade>
<TABLE BORDER=0 CELLPADDING=4 CELLSPACING=0 WIDTH=100%>
<COL WIDTH=194*> <COL WIDTH=31*> <COL WIDTH=31*>
<TR>
<TD COLSPAN=3 BGCOLOR="#666699">
<H3 ALIGN=LEFT STYLE="margin-top: 0cm; text-decoration: none"><FONT COLOR="#ffffff"><FONT SIZE=4>Contents</FONT></FONT></H3>
</TD>
</TR>
<TR>
<TD COLSPAN=3 height="26">
<p><a href="#Introduction">Introduction</a><br>
<a href="#ExampleBasic">Example in OpenOffice Basic</a></p>
</TD>
</TR>
<TR>
<TD COLSPAN=3 BGCOLOR="#666699">
<H3 ALIGN=LEFT STYLE="margin-top: 0cm; text-decoration: none"><FONT COLOR="#ffffff"><font color="#ffffff"><font size=4><a name="Introduction"></a><font color="#ffffff"></font></font></font><FONT SIZE=4>Introduction</FONT></FONT></H3>
</TD>
</TR>
<TR>
<TD COLSPAN=3 height="38">
<P STYLE="margin-bottom: 0cm">Before you can take advantage of your component
written in the programming language Java you have to load the Java component.
The process of the loading of the component is enabled by the Java Component
Loader.</P>
<P STYLE="margin-bottom: 0cm">In the following one describes, how you can
load a component written in Java. The example is based on the programming
language OpenOffice Basic. </P>
</TD>
</TR>
<tr>
<td colspan=3 bgcolor="#666699">
<h3><a name="ExampleBasic"></a><font color="#ffffff"><font face="Times New Roman, serif"><font size=4><b>Example
in OpenOffice Basic</b></font></font></font></h3>
</td>
</tr>
<tr>
<td colspan=3 height="175">
<p style="margin-bottom: 0cm">If you want access the services implemented
in a Java class file, you must create the UNO service &quot;com.sun.star.loader.Java2&quot;
to get the Java loader.</p>
<table width="100%" bgcolor=#ffffcc>
<tbody>
<tr>
<td height="2">
<pre>createUnoService(&quot;com.sun.star.loader.Java2&quot;)</pre>
</td>
</tr>
</tbody>
</table>
<p style="margin-bottom: 0cm">In order to register your component you should
create the implementation registration and register the desired service.</p>
<table width="100%" bgcolor=#ffffcc>
<tbody>
<tr>
<td height="2">
<pre>regImpl = createUnoService(&quot;com.sun.star.registry.ImplementationRegistration&quot;)<br>regImpl.registerImplementation(&quot;com.sun.star.loader.Java2&quot;, &quot;file:///E:/Trash/Inspector/InstanceInspector.jar&quot;, null)</pre>
</td>
</tr>
</tbody>
</table>
<p style="margin-bottom: 0cm">After suitable preparation you can create
your service:<br>
</p>
<table width="100%" bgcolor=#ffffcc>
<tbody>
<tr>
<td height="2">
<pre>objectInstanceInspector = createUnoService(&quot;com.sun.star.beans.InstanceInspector&quot;)</pre>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<TR>
<TD COLSPAN=3>
<P>&nbsp; </P>
</TD>
</TR>
<TR>
<TD COLSPAN=3>
<HR SIZE=1 noshade>
</TD>
</TR>
<TR>
<TD BGCOLOR="#666699">
<P ALIGN=LEFT><FONT COLOR="#ffffff"> Author: <A HREF="mailto:Bertram.Nolte@sun.com"><FONT COLOR="#ffffff">Bertram
Nolte</FONT></A> (Mon 18 Jun 2001 14:44:43)<BR>
<I>Copyright 2001 Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, CA 94303 USA.</I></FONT>
</P>
</TD>
<TR>
<TD COLSPAN=3>
<HR SIZE=1 noshade>
</TD>
</TR>
</TABLE>
<HR SIZE=3 noshade>
</body>
</HTML>