diff options
author | Joachim Lingner <jl@openoffice.org> | 2001-10-31 14:38:50 +0000 |
---|---|---|
committer | Joachim Lingner <jl@openoffice.org> | 2001-10-31 14:38:50 +0000 |
commit | 9f6c0f56c2fe04566fb805ef68943e3dc487583d (patch) | |
tree | 9ebc6b12cbd093dd4fa6c9fe84900269260644e4 /stoc/test/javavm | |
parent | 484943b7ebbc8b0cfb13276b427ff6cbea4f8a77 (diff) |
*** empty log message ***
Diffstat (limited to 'stoc/test/javavm')
-rw-r--r-- | stoc/test/javavm/testcomponent/TestComponent.java | 100 | ||||
-rw-r--r-- | stoc/test/javavm/testcomponent/makefile.mk | 16 |
2 files changed, 116 insertions, 0 deletions
diff --git a/stoc/test/javavm/testcomponent/TestComponent.java b/stoc/test/javavm/testcomponent/TestComponent.java new file mode 100644 index 000000000000..58da78805f9d --- /dev/null +++ b/stoc/test/javavm/testcomponent/TestComponent.java @@ -0,0 +1,100 @@ +import com.sun.star.comp.loader.FactoryHelper; +import com.sun.star.lang.*; +import com.sun.star.uno.*; +import com.sun.star.registry.XRegistryKey; + + +/** This component implements XTypeProvider for use with StarBasic. + * The XServiceInfo is implemented to have an interface in which we can put some + * code just for the sake of debugging. + * + * To debug with JPDA (jdk 1.3), put these lines in the java.ini within the [Java] section: + * -Xdebug + * -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y + * + * When the Virtual Machine service is instantiated it will block until the debugger + * attaches to it on port 8000. You can chose a different port. You attach to the VM using + * jdb by + * + * jdb -connect com.sun.jdi.SocketAttach:hostname=myhost,port=8000 + * + * myhost is the hostname where the VM is running. +*/ +public class TestComponent implements XServiceInfo, XTypeProvider +{ + public static final String __serviceName="JavaTestComponent"; + + // XTypeProvider + public com.sun.star.uno.Type[] getTypes( ) + { + Type[] retValue= new Type[2]; + retValue[0]= new Type( XServiceInfo.class); + retValue[1]= new Type( XTypeProvider.class); + return retValue; + } + // XTypeProvider + public byte[] getImplementationId( ) + { + return TestComponent.class.getName().getBytes(); + } + + + // XServiceName + public String getImplementationName( ) + { + String a= "the functions are for debugging"; + int abc= 34; + String prop= System.getProperty("ftp.proxyHost"); + prop= System.getProperty("ftp.proxyPort"); + prop= System.getProperty("http.proxyHost"); + prop= System.getProperty("http.proxyPort"); + prop= System.getProperty("ftp.nonProxyHosts"); + prop= System.getProperty("http.nonProxyHosts"); + prop= System.getProperty("socksProxyHost"); + prop= System.getProperty("socksProxyPort"); + return __serviceName; + } + // XServiceName + public boolean supportsService( /*IN*/String ServiceName ) + { + + return false; + } + + //XServiceName + public String[] getSupportedServiceNames( ) + { + String[] retValue= new String[0]; + return retValue; + } + + public static XSingleServiceFactory __getServiceFactory(String implName, + XMultiServiceFactory multiFactory, + XRegistryKey regKey) + { + XSingleServiceFactory xSingleServiceFactory = null; + + if (implName.equals( TestComponent.class.getName()) ) + xSingleServiceFactory = FactoryHelper.getServiceFactory( TestComponent.class, + TestComponent.__serviceName, + multiFactory, + regKey); + + return xSingleServiceFactory; + } + + /** + * Writes the service information into the given registry key. + * This method is called by the <code>JavaLoader</code> + * <p> + * @return returns true if the operation succeeded + * @param regKey the registryKey + * @see com.sun.star.comp.loader.JavaLoader + */ + public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) + { + return FactoryHelper.writeRegistryServiceInfo( TestComponent.class.getName(), + TestComponent.__serviceName, regKey); + } + +}
\ No newline at end of file diff --git a/stoc/test/javavm/testcomponent/makefile.mk b/stoc/test/javavm/testcomponent/makefile.mk new file mode 100644 index 000000000000..4520d70783cb --- /dev/null +++ b/stoc/test/javavm/testcomponent/makefile.mk @@ -0,0 +1,16 @@ +#************************************************************************* +#* +#* $RCSfile: makefile.mk,v $ +#* +#* Creation date 09/19/2001 +#* last change $Author: jl $ $Date: 2001-10-31 15:38:50 $ +#* $Revision: 1.1 $ +#* +#* Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. +#* +#************************************************************************* +TARGET=JavaTestComponent +PRJ=../../.. + +.INCLUDE : ant.mk +ALLTAR: ANTBUILD |