summaryrefslogtreecommitdiff
path: root/jurt/com/sun/star/comp
diff options
context:
space:
mode:
authorrbuj <robert.buj@gmail.com>2014-07-23 18:51:20 +0200
committerMichael Stahl <mstahl@redhat.com>2014-07-24 13:11:41 +0200
commitb01358553082fd6f30781d0641c652f206c90c63 (patch)
tree24aa9acf9d1331ded2a12aef1cc230b267ea8e49 /jurt/com/sun/star/comp
parentc8aa8226962db6ddbca6bfec8e415dfd5ecdda6f (diff)
jurt: Enhanced For-Loops, code formatting, javadoc & overrides
Signed-off-by: Michael Stahl <mstahl@redhat.com> Conflicts: jurt/com/sun/star/lib/uno/environments/remote/JobQueue.java Change-Id: I6d6324c5597fa472360a1b8bb4153dec647a36f0
Diffstat (limited to 'jurt/com/sun/star/comp')
-rw-r--r--jurt/com/sun/star/comp/bridgefactory/BridgeFactory.java60
-rw-r--r--jurt/com/sun/star/comp/connections/Acceptor.java5
-rw-r--r--jurt/com/sun/star/comp/connections/ConstantInstanceProvider.java24
-rw-r--r--jurt/com/sun/star/comp/connections/PipedConnection.java69
-rw-r--r--jurt/com/sun/star/comp/loader/FactoryHelper.java178
-rw-r--r--jurt/com/sun/star/comp/loader/JavaLoader.java229
-rw-r--r--jurt/com/sun/star/comp/loader/JavaLoaderFactory.java18
-rw-r--r--jurt/com/sun/star/comp/servicemanager/ServiceManager.java193
-rw-r--r--jurt/com/sun/star/comp/urlresolver/UrlResolver.java16
9 files changed, 403 insertions, 389 deletions
diff --git a/jurt/com/sun/star/comp/bridgefactory/BridgeFactory.java b/jurt/com/sun/star/comp/bridgefactory/BridgeFactory.java
index 9d3920e88f1a..7e370a980174 100644
--- a/jurt/com/sun/star/comp/bridgefactory/BridgeFactory.java
+++ b/jurt/com/sun/star/comp/bridgefactory/BridgeFactory.java
@@ -36,11 +36,12 @@ import com.sun.star.uno.UnoRuntime;
/**
* The BridgeFactory class implements the <code>XBridgeFactory</code> Interface.
- * It wrapps the <code>UnoRuntime#getBridgeByName</code>method and delivers a
- * XBridge component.
- * <p>
- * This component is only usable for remote bridges.
- * <p>
+ *
+ * <p>It wrapps the <code>UnoRuntime#getBridgeByName</code>method and delivers a
+ * XBridge component.</p>
+ *
+ * <p>This component is only usable for remote bridges.</p>
+ *
* @see com.sun.star.uno.UnoRuntime
* @since UDK1.0
*/
@@ -48,18 +49,21 @@ public class BridgeFactory implements XBridgeFactory/*, XEventListener*/ {
static private final boolean DEBUG = false;
/**
- * The name of the service, the <code>JavaLoader</code> acceses this through reflection.
+ * The name of the service, the <code>JavaLoader</code> acceses this through
+ * reflection.
*/
public final static String __serviceName = "com.sun.star.bridge.BridgeFactory";
/**
* Gives a factory for creating the service.
- * This method is called by the <code>JavaLoader</code>
- * <p>
- * @return returns a <code>XSingleServiceFactory</code> for creating the component
- * @param implName the name of the implementation for which a service is desired
- * @param multiFactory the service manager to be uses if needed
- * @param regKey the registryKey
+ *
+ * <p>This method is called by the <code>JavaLoader</code>.</p>
+ *
+ * @param implName the name of the implementation for which a service is desired.
+ * @param multiFactory the service manager to be uses if needed.
+ * @param regKey the registryKey.
+ * @return returns a <code>XSingleServiceFactory</code> for creating the component.
+ *
* @see com.sun.star.comp.loader.JavaLoader
*/
public static XSingleServiceFactory __getServiceFactory(String implName,
@@ -78,11 +82,12 @@ public class BridgeFactory implements XBridgeFactory/*, XEventListener*/ {
/**
* Creates a remote bridge and memorizes it under <code>sName</code>.
- * <p>
- * @return the bridge
- * @param sName the name to memorize the bridge
- * @param sProtocol the protocol the bridge should use
- * @param anInstanceProvider the instance provider
+ *
+ * @param sName the name to memorize the bridge.
+ * @param sProtocol the protocol the bridge should use.
+ * @param anInstanceProvider the instance provider.
+ * @return the bridge.
+ *
* @see com.sun.star.bridge.XBridgeFactory
*/
public XBridge createBridge(String sName, String sProtocol, XConnection aConnection, XInstanceProvider anInstanceProvider) throws
@@ -132,9 +137,9 @@ public class BridgeFactory implements XBridgeFactory/*, XEventListener*/ {
/**
* Gets a remote bridge which must already exist.
- * <p>
- * @return the bridge
- * @param sName the name of the bridge
+ *
+ * @param sName the name of the bridge.
+ * @return the bridge.
* @see com.sun.star.bridge.XBridgeFactory
*/
public XBridge getBridge(String sName) throws com.sun.star.uno.RuntimeException {
@@ -160,10 +165,10 @@ public class BridgeFactory implements XBridgeFactory/*, XEventListener*/ {
}
/**
- * Gives all created bridges
- * <p>
- * @return the bridges
- * @see com.sun.star.bridge.XBridgeFactory
+ * Gives all created bridges.
+ *
+ * @return the bridges.
+ * @see com.sun.star.bridge.XBridgeFactory
*/
public synchronized XBridge[] getExistingBridges() throws com.sun.star.uno.RuntimeException {
ArrayList<XBridge> vector = new ArrayList<XBridge>();
@@ -191,6 +196,13 @@ public class BridgeFactory implements XBridgeFactory/*, XEventListener*/ {
}
}
+ /**
+ * Returns a string representation of the object.
+ *
+ * @return a string representation of the object.
+ * @see java.lang.Object#toString
+ */
+ @Override
public String toString() {
return token;
}
diff --git a/jurt/com/sun/star/comp/connections/Acceptor.java b/jurt/com/sun/star/comp/connections/Acceptor.java
index cc7ce7635bb0..7c8e0e9e494b 100644
--- a/jurt/com/sun/star/comp/connections/Acceptor.java
+++ b/jurt/com/sun/star/comp/connections/Acceptor.java
@@ -128,7 +128,10 @@ public final class Acceptor implements XAcceptor {
return acc.accept(connectionDescription);
}
- // see com.sun.star.connection.XAcceptor#stopAccepting
+ /**
+ *
+ * @see com.sun.star.connection.XAcceptor#stopAccepting
+ */
public void stopAccepting() {
XAcceptor acc;
synchronized (this) {
diff --git a/jurt/com/sun/star/comp/connections/ConstantInstanceProvider.java b/jurt/com/sun/star/comp/connections/ConstantInstanceProvider.java
index 95f3016f5f71..687f70efe9ad 100644
--- a/jurt/com/sun/star/comp/connections/ConstantInstanceProvider.java
+++ b/jurt/com/sun/star/comp/connections/ConstantInstanceProvider.java
@@ -31,7 +31,7 @@ import com.sun.star.comp.loader.FactoryHelper;
/**
* The <code>ConstantInstanceProvider</code> is a component
* that implements the <code>XInstanceProvider</code> Interface.
- * <p>
+ *
* @see com.sun.star.bridge.XBridge
* @see com.sun.star.bridge.XBridgeFactory
* @see com.sun.star.bridge.XInstanceProvider
@@ -45,18 +45,20 @@ public class ConstantInstanceProvider implements XInstanceProvider {
static public final boolean DEBUG = false;
/**
- * The name of the service, the <code>JavaLoader</code> acceses this through reflection.
+ * The name of the service, the <code>JavaLoader</code> acceses this through
+ * reflection.
*/
static private final String __serviceName = "com.sun.star.comp.connection.InstanceProvider";
/**
* Gives a factory for creating the service.
- * This method is called by the <code>JavaLoader</code>
- * <p>
- * @return returns a <code>XSingleServiceFactory</code> for creating the component
- * @param implName the name of the implementation for which a service is desired
- * @param multiFactory the service manager to be uses if needed
- * @param regKey the registryKey
+ * <p>This method is called by the <code>JavaLoader</code>.</p>
+ *
+ * @param implName the name of the implementation for which a service is desired.
+ * @param multiFactory the service manager to be uses if needed.
+ * @param regKey the registryKey.
+ * @return returns a <code>XSingleServiceFactory</code> for creating the component.
+ *
* @see com.sun.star.comp.loader.JavaLoader
*/
public static XSingleServiceFactory __getServiceFactory(String implName,
@@ -86,8 +88,8 @@ public class ConstantInstanceProvider implements XInstanceProvider {
/**
* Constructs a new <code>ConstantInstanceProvider</code>.
- * Uses the provided ServiceManager as the provided instance.
- * <p>
+ * <p>Uses the provided ServiceManager as the provided instance.</p>
+ *
* @param serviceManager the provided service manager
*/
public ConstantInstanceProvider(XMultiServiceFactory serviceManager) {
@@ -99,7 +101,7 @@ public class ConstantInstanceProvider implements XInstanceProvider {
/**
* Gives an object for the passed instance name.
- * <p>
+ *
* @return the desired instance
* @param sInstanceName the name of the desired instance
*/
diff --git a/jurt/com/sun/star/comp/connections/PipedConnection.java b/jurt/com/sun/star/comp/connections/PipedConnection.java
index 12f18957db36..d48b2a63df0e 100644
--- a/jurt/com/sun/star/comp/connections/PipedConnection.java
+++ b/jurt/com/sun/star/comp/connections/PipedConnection.java
@@ -29,11 +29,10 @@ import com.sun.star.lang.XSingleServiceFactory;
import com.sun.star.registry.XRegistryKey;
/**
- * The PipedConnection is a component that implements the
+ * The <code>PipedConnection</code> is a component that implements the
* <code>XConnection</code> Interface.
- * It is useful for <code>Thread</code> communication
- * in one Process.
- * <p>
+ * <p>It is useful for <code>Thread</code> communication in one Process.</p>
+ *
* @see com.sun.star.connection.XConnection
* @see com.sun.star.comp.loader.JavaLoader
* @since UDK1.0
@@ -45,18 +44,20 @@ public class PipedConnection implements XConnection {
public static final boolean DEBUG = false;
/**
- * The name of the service, the <code>JavaLoader</code> acceses this through reflection.
+ * The name of the service, the <code>JavaLoader</code> acceses this through
+ * reflection.
*/
static private final String __serviceName = "com.sun.star.connection.PipedConnection";
/**
* Gives a factory for creating the service.
- * This method is called by the <code>JavaLoader</code>
- * <p>
- * @return returns a <code>XSingleServiceFactory</code> for creating the component
- * @param implName the name of the implementation for which a service is desired
- * @param multiFactory the service manager to be uses if needed
- * @param regKey the registryKey
+ * <p>This method is called by the <code>JavaLoader</code>.</p>
+ *
+ * @param implName the name of the implementation for which a service is desired.
+ * @param multiFactory the service manager to be uses if needed.
+ * @param regKey the registryKey.
+ * @return returns a <code>XSingleServiceFactory</code> for creating the component.
+ *
* @see com.sun.star.comp.loader.JavaLoader
*/
public static XSingleServiceFactory __getServiceFactory(String implName,
@@ -75,8 +76,7 @@ public class PipedConnection implements XConnection {
}
/**
- * The amount of time in milliseconds, to wait to
- * see check the buffers.
+ * The amount of time in milliseconds, to wait to see check the buffers.
*/
protected static final int __waitTime = 10000;
@@ -87,9 +87,9 @@ public class PipedConnection implements XConnection {
protected PipedConnection _otherSide;
/**
- * Constructs a new <code>PipedConnection</code>, sees if there
- * is an other side, which it should be connected to.
- * <p>
+ * Constructs a new <code>PipedConnection</code>, sees if there is an other
+ * side, which it should be connected to.
+ *
* @param args Another side could be in index 0.
*/
public PipedConnection(Object args[]) throws com.sun.star.uno.RuntimeException {
@@ -105,8 +105,7 @@ public class PipedConnection implements XConnection {
}
/**
- * This is a private method, used to cummunicate
- * internal in the pipe.
+ * This is a private method, used to cummunicate internal in the pipe.
*/
private synchronized void receive(byte aData[]) throws com.sun.star.io.IOException {
int bytesWritten = 0;
@@ -155,11 +154,12 @@ public class PipedConnection implements XConnection {
/**
* Read the required number of bytes.
- * <p>
- * @return the number of bytes read
- * @param aReadBytes the out parameter, where the bytes have to be placed
- * @param nBytesToRead the number of bytes to read
- * @see com.sun.star.connection.XConnection#read
+ *
+ * @param aReadBytes the out parameter, where the bytes have to be placed.
+ * @param nBytesToRead the number of bytes to read.
+ * @return the number of bytes read.
+ *
+ * @see com.sun.star.connection.XConnection#read
*/
public synchronized int read(/*OUT*/byte[][] aReadBytes, int nBytesToRead) throws com.sun.star.io.IOException, com.sun.star.uno.RuntimeException {
aReadBytes[0] = new byte[nBytesToRead];
@@ -211,18 +211,19 @@ public class PipedConnection implements XConnection {
/**
* Write bytes.
- * <p>
- * @param aData the bytes to write
- * @see com.sun.star.connection.XConnection#write
+ *
+ * @param aData the bytes to write.
+ * @see com.sun.star.connection.XConnection#write
*/
public void write(byte aData[]) throws com.sun.star.io.IOException, com.sun.star.uno.RuntimeException {
_otherSide.receive(aData);
}
/**
- * Flushes the buffer, notifies if necessary the other side that new data has arrived.
- * <p>
- * @see com.sun.star.connection.XConnection#flush
+ * Flushes the buffer, notifies if necessary the other side that new data has
+ * arrived.
+ *
+ * @see com.sun.star.connection.XConnection#flush
*/
public void flush() throws com.sun.star.io.IOException, com.sun.star.uno.RuntimeException {
synchronized(_otherSide) {
@@ -232,8 +233,8 @@ public class PipedConnection implements XConnection {
/**
* Closes the pipe.
- * <p>
- * @see com.sun.star.connection.XConnection#close()
+ *
+ * @see com.sun.star.connection.XConnection#close()
*/
public synchronized void close() throws com.sun.star.io.IOException, com.sun.star.uno.RuntimeException {
if(!_closed) {
@@ -247,9 +248,9 @@ public class PipedConnection implements XConnection {
/**
* Gives a description of this pipe.
- * <p>
- * @return the description
- * @see com.sun.star.connection.XConnection#getDescription
+ *
+ * @return the description.
+ * @see com.sun.star.connection.XConnection#getDescription
*/
public String getDescription() throws com.sun.star.uno.RuntimeException {
return getClass().getName();
diff --git a/jurt/com/sun/star/comp/loader/FactoryHelper.java b/jurt/com/sun/star/comp/loader/FactoryHelper.java
index 861f4e910733..191aa1d9e833 100644
--- a/jurt/com/sun/star/comp/loader/FactoryHelper.java
+++ b/jurt/com/sun/star/comp/loader/FactoryHelper.java
@@ -18,7 +18,6 @@
package com.sun.star.comp.loader;
-
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
@@ -39,9 +38,10 @@ import com.sun.star.uno.Type;
/**
* The purpose of this class to help component implementation.
- * This class has default implementations for <code>getServiceFactory</code>
- * and <code>writeRegistryServiceInfo</code>.
- * <p>
+ *
+ * <p>This class has default implementations for <code>getServiceFactory</code>
+ * and <code>writeRegistryServiceInfo</code>.</p>
+ *
* @see com.sun.star.lang.XMultiServiceFactory
* @see com.sun.star.lang.XServiceInfo
* @see com.sun.star.lang.XSingleServiceFactory
@@ -207,12 +207,9 @@ public class FactoryHelper {
break;
}
- try
- {
+ try {
return _constructor.newInstance( args );
- }
- catch (InvocationTargetException invocationTargetException)
- {
+ } catch (InvocationTargetException invocationTargetException) {
Throwable targetException = invocationTargetException.getTargetException();
if (targetException instanceof java.lang.RuntimeException)
@@ -223,13 +220,9 @@ public class FactoryHelper {
throw (com.sun.star.uno.RuntimeException)targetException;
else
throw new com.sun.star.uno.Exception( targetException.toString() );
- }
- catch (IllegalAccessException illegalAccessException)
- {
+ } catch (IllegalAccessException illegalAccessException) {
throw new com.sun.star.uno.Exception( illegalAccessException.toString() );
- }
- catch (InstantiationException instantiationException)
- {
+ } catch (InstantiationException instantiationException) {
throw new com.sun.star.uno.Exception( instantiationException.toString() );
}
}
@@ -280,8 +273,7 @@ public class FactoryHelper {
break;
}
- try
- {
+ try {
Object instance = _constructor.newInstance( args );
if (bInitCall)
{
@@ -293,9 +285,7 @@ public class FactoryHelper {
}
}
return instance;
- }
- catch (InvocationTargetException invocationTargetException)
- {
+ } catch (InvocationTargetException invocationTargetException) {
Throwable targetException = invocationTargetException.getTargetException();
if (targetException instanceof java.lang.RuntimeException)
@@ -306,22 +296,18 @@ public class FactoryHelper {
throw (com.sun.star.uno.RuntimeException)targetException;
else
throw new com.sun.star.uno.Exception( targetException.toString() );
- }
- catch (IllegalAccessException illegalAccessException)
- {
+ } catch (IllegalAccessException illegalAccessException) {
throw new com.sun.star.uno.Exception( illegalAccessException.toString() );
- }
- catch (InstantiationException instantiationException)
- {
+ } catch (InstantiationException instantiationException) {
throw new com.sun.star.uno.Exception( instantiationException.toString() );
}
}
/**
* Creates an instance of the desired service.
- * <p>
- * @return returns an instance of the desired service
- * @see com.sun.star.lang.XSingleServiceFactory
+ *
+ * @return returns an instance of the desired service.
+ * @see com.sun.star.lang.XSingleServiceFactory
*/
public Object createInstance()
throws com.sun.star.uno.Exception,
@@ -330,12 +316,13 @@ public class FactoryHelper {
return createInstanceWithContext( null );
}
- /**
+ /**
* Creates an instance of the desired service.
- * <p>
- * @return returns an instance of the desired service
- * @param args the args given to the constructor of the service
- * @see com.sun.star.lang.XSingleServiceFactory
+ *
+ * @param args the args given to the constructor of the service.
+ * @return returns an instance of the desired service.
+ *
+ * @see com.sun.star.lang.XSingleServiceFactory
*/
public Object createInstanceWithArguments(Object[] args)
throws com.sun.star.uno.Exception,
@@ -344,31 +331,31 @@ public class FactoryHelper {
return createInstanceWithArgumentsAndContext( args, null );
}
- /**
- * Gives the supported services
- * <p>
- * @return returns an array of supported services
- * @see com.sun.star.lang.XServiceInfo
+ /**
+ * Gives the supported services.
+ *
+ * @return returns an array of supported services.
+ * @see com.sun.star.lang.XServiceInfo
*/
public String[] getSupportedServiceNames() throws com.sun.star.uno.RuntimeException {
return new String[]{_serviceName};
}
- /**
- * Gives the implementation name
- * <p>
- * @return returns the implementation name
- * @see com.sun.star.lang.XServiceInfo
+ /**
+ * Gives the implementation name.
+ *
+ * @return returns the implementation name.
+ * @see com.sun.star.lang.XServiceInfo
*/
public String getImplementationName() throws com.sun.star.uno.RuntimeException {
return _implName;
}
- /**
+ /**
* Indicates if the given service is supported.
- * <p>
- * @return returns true if the given service is supported
- * @see com.sun.star.lang.XServiceInfo
+ *
+ * @return returns true if the given service is supported.
+ * @see com.sun.star.lang.XServiceInfo
*/
public boolean supportsService(String serviceName) throws com.sun.star.uno.RuntimeException {
String services[] = getSupportedServiceNames();
@@ -402,14 +389,14 @@ public class FactoryHelper {
/**
* Creates a factory for the given class.
- * <p>
+ *
+ * @param implClass the implementing class.
+ * @param multiFactory the given multi service factory (service manager).
+ * @param regKey the given registry key.
+ * @return returns a factory.
+ *
+ * @see com.sun.star.lang.XServiceInfo
* @deprecated as of UDK 1.0
- * <p>
- * @return returns a factory
- * @param implClass the implementing class
- * @param multiFactory the given multi service factory (service manager)
- * @param regKey the given registry key
- * @see com.sun.star.lang.XServiceInfo
*/
static public XSingleServiceFactory getServiceFactory(Class<?> implClass,
XMultiServiceFactory multiFactory,
@@ -422,17 +409,14 @@ public class FactoryHelper {
try {
serviceName = implClass.getField("__serviceName");
- }
- catch(NoSuchFieldException noSuchFieldExceptio) {
+ } catch(NoSuchFieldException noSuchFieldExceptio) {
serviceName = implClass.getField("serviceName"); // old style
}
xSingleServiceFactory = new Factory(implClass, (String)serviceName.get(null), multiFactory, regKey);
- }
- catch(NoSuchFieldException noSuchFieldException) {
+ } catch(NoSuchFieldException noSuchFieldException) {
System.err.println("##### FactoryHelper.getServiceFactory - exception:" + noSuchFieldException);
- }
- catch(IllegalAccessException illegalAccessException) {
+ } catch(IllegalAccessException illegalAccessException) {
System.err.println("##### FactoryHelper.getServiceFactory - exception:" + illegalAccessException);
}
@@ -441,13 +425,14 @@ public class FactoryHelper {
/**
* Creates a factory for the given class.
- * <p>
- * @return returns a factory
- * @param implClass the implementing class
- * @param serviceName the service name of the implementing class
- * @param multiFactory the given multi service factory (service manager)
- * @param regKey the given registry key
- * @see com.sun.star.lang.XServiceInfo
+ *
+ * @param implClass the implementing class.
+ * @param serviceName the service name of the implementing class.
+ * @param multiFactory the given multi service factory (service manager).
+ * @param regKey the given registry key.
+ *
+ * @return returns a factory.
+ * @see com.sun.star.lang.XServiceInfo
*/
static public XSingleServiceFactory getServiceFactory(Class<?> implClass,
String serviceName,
@@ -457,24 +442,26 @@ public class FactoryHelper {
return new Factory(implClass, serviceName, multiFactory, regKey);
}
- /** Creates a factory for the given class.
-
- @return returns a factory object
- @param implClass the implementing class
- */
+ /**
+ * Creates a factory for the given class.
+ *
+ * @param implClass the implementing class.
+ * @return returns a factory object.
+ */
static public Object createComponentFactory( Class<?> implClass, String serviceName )
{
return new Factory( implClass, serviceName, null, null );
}
/**
- * Writes the registration data into the registry key
- * <p>
- * @return success
- * @param implName the name of the implementing class
- * @param serviceName the service name
- * @param regKey the given registry key
- * @see com.sun.star.lang.XServiceInfo
+ * Writes the registration data into the registry key.
+ *
+ * @param implName the name of the implementing class.
+ * @param serviceName the service name.
+ * @param regKey the given registry key.
+ * @return success.
+ *
+ * @see com.sun.star.lang.XServiceInfo
*/
static public boolean writeRegistryServiceInfo(String implName, String serviceName, XRegistryKey regKey) {
boolean result = false;
@@ -493,35 +480,32 @@ public class FactoryHelper {
return result;
}
- /** Writes the registration data into the registry key.
- * Several services are supported.
+ /**
+ * Writes the registration data into the registry key.
+ *
+ * <p>Several services are supported.</p>
*
- * @param impl_name name of implementation
- * @param supported_services supported services of implementation
- * @param xKey registry key to write to
- * @return success
- */
+ * @param impl_name name of implementation.
+ * @param supported_services supported services of implementation.
+ * @param xKey registry key to write to.
+ * @return success.
+ */
public static boolean writeRegistryServiceInfo(
String impl_name, String supported_services [], XRegistryKey xKey )
{
- try
- {
+ try {
XRegistryKey xNewKey = xKey.createKey( "/" + impl_name + "/UNO/SERVICES" );
- for ( int nPos = 0; nPos < supported_services.length; ++nPos )
- {
+ for ( int nPos = 0; nPos < supported_services.length; ++nPos ) {
xNewKey.createKey( supported_services[ nPos ] );
}
return true;
- }
- catch (com.sun.star.registry.InvalidRegistryException exc)
- {
- if (DEBUG)
- {
+ } catch (com.sun.star.registry.InvalidRegistryException exc) {
+ if (DEBUG) {
System.err.println(
"##### " + Factory.class.getName() + ".writeRegistryServiceInfo -- exc: " +
exc.toString() );
}
- }
+ }
return false;
}
diff --git a/jurt/com/sun/star/comp/loader/JavaLoader.java b/jurt/com/sun/star/comp/loader/JavaLoader.java
index 98df09b4d4be..bfcb6703e083 100644
--- a/jurt/com/sun/star/comp/loader/JavaLoader.java
+++ b/jurt/com/sun/star/comp/loader/JavaLoader.java
@@ -19,9 +19,7 @@
package com.sun.star.comp.loader;
import java.lang.reflect.Method;
-
import java.lang.reflect.InvocationTargetException;
-
import java.net.URLDecoder;
import com.sun.star.loader.CannotActivateFactoryException;
@@ -49,10 +47,14 @@ import com.sun.star.uno.AnyConverter;
/**
- * The <code>JavaLoader</code> class provides the functionality of the <code>com.sun.star.loader.Java</code>
- * service. Therefor the <code>JavaLoader</code> activates external UNO components which are implemented in Java.
- * The loader is used by the <code>ServiceManger</code>.
- * <p>
+ * The <code>JavaLoader</code> class provides the functionality of the
+ * <code>com.sun.star.loader.Java</code> service.
+ *
+ * <p>Therefor the <code>JavaLoader</code> activates external UNO components
+ * which are implemented in Java.</p>
+ *
+ * <p>The loader is used by the <code>ServiceManger</code>.</p>
+ *
* @see com.sun.star.loader.XImplementationLoader
* @see com.sun.star.loader.Java
* @see com.sun.star.comp.servicemanager.ServiceManager
@@ -77,21 +79,18 @@ public class JavaLoader implements XImplementationLoader,
private XMacroExpander m_xMacroExpander = null;
private static final String EXPAND_PROTOCOL_PREFIX = "vnd.sun.star.expand:";
- /** Expands macrofied url using the macro expander singleton.
+ /**
+ * Expands macrofied url using the macro expander singleton.
*/
private String expand_url( String url ) throws RuntimeException
{
- if (url != null && url.startsWith( EXPAND_PROTOCOL_PREFIX ))
- {
- try
- {
- if (m_xMacroExpander == null)
- {
+ if (url != null && url.startsWith( EXPAND_PROTOCOL_PREFIX )) {
+ try {
+ if (m_xMacroExpander == null) {
XPropertySet xProps =
UnoRuntime.queryInterface(
XPropertySet.class, multiServiceFactory );
- if (xProps == null)
- {
+ if (xProps == null) {
throw new com.sun.star.uno.RuntimeException(
"service manager does not support XPropertySet!",
this );
@@ -113,21 +112,16 @@ public class JavaLoader implements XImplementationLoader,
'+', "%2B" ) );
// expand macro string
String ret = m_xMacroExpander.expandMacros( macro );
- if (DEBUG)
- {
+ if (DEBUG) {
System.err.println(
"JavaLoader.expand_url(): " + url + " => " +
macro + " => " + ret );
}
return ret;
- }
- catch (com.sun.star.uno.Exception exc)
- {
+ } catch (com.sun.star.uno.Exception exc) {
throw new com.sun.star.uno.RuntimeException(
exc.getMessage(), this );
- }
- catch (java.lang.Exception exc)
- {
+ } catch (java.lang.Exception exc) {
throw new com.sun.star.uno.RuntimeException(
exc.getMessage(), this );
}
@@ -135,22 +129,24 @@ public class JavaLoader implements XImplementationLoader,
return url;
}
- /** default constructor
- */
-
/**
- * Creates a new instance of the <code>JavaLoader</code> class.
- * <p>
+ * Default constructor.
+ *
+ * <p>Creates a new instance of the <code>JavaLoader</code> class.</p>
*/
public JavaLoader() {}
/**
- * Creates a new <code>JavaLoader</code> object. The specified <code>com.sun.star.lang.XMultiServiceFactory</code>
- * is the <code>ServiceManager</code> service which can be deliviert to all components the <code>JavaLoader</code> is
- * loading.
- * To set the <code>MultiServiceFactory</code> you can use the <code>com.sun.star.lang.XInitialization</code> interface, either.
- * <p>
- * @param factory the <code>ServiceManager</code>
+ * Creates a new <code>JavaLoader</code> object.
+ *
+ * <p>The specified <code>com.sun.star.lang.XMultiServiceFactory</code> is
+ * the <code>ServiceManager</code> service which can be deliviert to all
+ * components the <code>JavaLoader</code> is loading.</p>
+ *
+ * <p>To set the <code>MultiServiceFactory</code> you can use the
+ * <code>com.sun.star.lang.XInitialization</code> interface, either.</p>
+ *
+ * @param factory the <code>ServiceManager</code>.
* @see com.sun.star.comp.servicemanager.ServiceManager
* @see com.sun.star.lang.XInitialization
*/
@@ -159,10 +155,11 @@ public class JavaLoader implements XImplementationLoader,
}
/**
- * Unlike the original intention, the method could be called every time a new
- * <code>com.sun.star.lang.XMultiServiceFactory</code> should be set at the loader.
- * <p>
- * @param args - the first parameter (args[0]) specifices the <code>ServiceManager</code>
+ * Unlike the original intention, the method could be called every time a
+ * new <code>com.sun.star.lang.XMultiServiceFactory</code> should be set at
+ * the loader.
+ *
+ * @param args - the first parameter (args[0]) specifices the <code>ServiceManager</code>.
* @see com.sun.star.lang.XInitialization
* @see com.sun.star.comp.servicemanager.ServiceManager
*/
@@ -170,13 +167,13 @@ public class JavaLoader implements XImplementationLoader,
throws com.sun.star.uno.Exception,
com.sun.star.uno.RuntimeException
{
- if (args.length == 0) throw new com.sun.star.lang.IllegalArgumentException("No arguments specified");
+ if (args.length == 0)
+ throw new com.sun.star.lang.IllegalArgumentException("No arguments specified");
try {
multiServiceFactory = (XMultiServiceFactory) AnyConverter.toObject(
new Type(XMultiServiceFactory.class), args[0]);
- }
- catch (ClassCastException castEx) {
+ } catch (ClassCastException castEx) {
throw new com.sun.star.lang.IllegalArgumentException(
"The argument must be an instance of XMultiServiceFactory");
}
@@ -184,8 +181,8 @@ public class JavaLoader implements XImplementationLoader,
/**
* Supplies the implementation name of the component.
- * <p>
- * @return the implementation name - here the class name
+ *
+ * @return the implementation name - here the class name.
* @see com.sun.star.lang.XServiceInfo
*/
public String getImplementationName()
@@ -196,25 +193,27 @@ public class JavaLoader implements XImplementationLoader,
/**
* Verifies if a given service is supported by the component.
- * <p>
- * @return true,if service is supported - otherwise false
- * @param serviceName the name of the service that should be checked
+ *
+ * @param serviceName the name of the service that should be checked.
+ * @return true,if service is supported - otherwise false.
+ *
* @see com.sun.star.lang.XServiceInfo
*/
public boolean supportsService(String serviceName)
throws com.sun.star.uno.RuntimeException
{
- for ( int i = 0; i < supportedServices.length; i++ ) {
- if ( supportedServices[i].equals(serviceName) )
+ for (String supportedService : supportedServices) {
+ if (supportedService.equals(serviceName)) {
return true;
+ }
}
return false;
}
/**
- * Supplies a list of all service names supported by the component
- * <p>
- * @return a String array with all supported services
+ * Supplies a list of all service names supported by the component.
+ *
+ * @return a String array with all supported services.
* @see com.sun.star.lang.XServiceInfo
*/
public String[] getSupportedServiceNames()
@@ -225,18 +224,23 @@ public class JavaLoader implements XImplementationLoader,
/**
* Provides a components factory.
- * The <code>JavaLoader</code> tries to load the class first. If a loacation URL is given the
- * RegistrationClassFinder is used to load the class. Otherwise the class is loaded thru the Class.forName
- * method.
- * To get the factory the inspects the class for the optional static member functions __getServiceFactory resp.
- * getServiceFactory (DEPRECATED).
- * If the function can not be found a default factory @see ComponentFactoryWrapper will be created.
- * <p>
- * @return the factory for the component (@see com.sun.star.lang.XSingleServiceFactory)
- * @param implementationName the implementation (class) name of the component
+ *
+ * <p>The <code>JavaLoader</code> tries to load the class first. If a
+ * loacation URL is given the RegistrationClassFinder is used to load the
+ * class. Otherwise the class is loaded thru the Class.forName method.</p>
+ *
+ * <p>To get the factory the inspects the class for the optional static member
+ * functions __getServiceFactory resp. getServiceFactory (DEPRECATED).</p>
+ *
+ * <p>If the function can not be found a default factory @see ComponentFactoryWrapper
+ * will be created.</p>
+ *
+ * @param implementationName the implementation (class) name of the component.
* @param implementationLoaderUrl the URL of the implementation loader. Not used.
- * @param locationUrl points to an archive (JAR file) which contains a component
- * @param xKey registry key
+ * @param locationUrl points to an archive (JAR file) which contains a component.
+ * @param xKey registry key.
+ * @return the factory for the component (@see com.sun.star.lang.XSingleServiceFactory)
+ *
* @see com.sun.star.loader.XImplementationLoader
* @see com.sun.star.comp.loader.RegistrationClassFinder
*/
@@ -254,7 +258,7 @@ public class JavaLoader implements XImplementationLoader,
DEBUG("try to get factory for " + implementationName);
- // first we must get the class of the implementation
+ // First we must get the class of the implementation
// 1. If a location URL is given it is assumed that this points to a JAR file.
// The components class name is stored in the manifest file.
// 2. If only the implementation name is given, the class is loaded with the
@@ -274,20 +278,17 @@ public class JavaLoader implements XImplementationLoader,
"Cannot find class " + implementationName);
}
}
- }
- catch (java.net.MalformedURLException e) {
+ } catch (java.net.MalformedURLException e) {
CannotActivateFactoryException cae = new CannotActivateFactoryException(
"Can not activate factory because " + e );
cae.initCause(e);
throw cae;
- }
- catch (java.io.IOException e) {
+ } catch (java.io.IOException e) {
CannotActivateFactoryException cae = new CannotActivateFactoryException(
"Can not activate factory because " + e );
cae.initCause(e);
throw cae;
- }
- catch (java.lang.ClassNotFoundException e) {
+ } catch (java.lang.ClassNotFoundException e) {
CannotActivateFactoryException cae = new CannotActivateFactoryException(
"Can not activate factory because " + e );
cae.initCause(e);
@@ -303,69 +304,56 @@ public class JavaLoader implements XImplementationLoader,
// - old style: use the public static method getServiceFactory ( DEPRECATED )
Method compfac_method = null;
- try
- {
+ try {
compfac_method = clazz.getMethod(
"__getComponentFactory", new Class [] { String.class } );
+ } catch ( NoSuchMethodException noSuchMethodEx) {
+ } catch ( SecurityException secEx) {
}
- catch ( NoSuchMethodException noSuchMethodEx) {}
- catch ( SecurityException secEx) {}
Method method = null;
- if (null == compfac_method)
- {
+ if (null == compfac_method) {
try {
method = clazz.getMethod("__getServiceFactory", paramTypes);
- }
- catch ( NoSuchMethodException noSuchMethodEx) {
+ } catch ( NoSuchMethodException noSuchMethodEx) {
method = null;
- }
- catch ( SecurityException secEx) {
+ } catch ( SecurityException secEx) {
method = null;
}
}
try {
- if (null != compfac_method)
- {
+ if (null != compfac_method) {
Object ret = compfac_method.invoke( clazz, new Object [] { implementationName } );
if (null == ret || !(ret instanceof XSingleComponentFactory))
- {
throw new CannotActivateFactoryException(
"No factory object for " + implementationName );
- }
+
return ret;
}
- else
- {
- if ( method == null ) {
+ else {
+ if ( method == null )
method = clazz.getMethod("getServiceFactory", paramTypes);
- }
Object oRet = method.invoke(clazz, params);
- if ( (oRet != null) && (oRet instanceof XSingleServiceFactory) ) {
+ if ( (oRet != null) && (oRet instanceof XSingleServiceFactory) )
returnObject = oRet;
- }
}
- }
- catch ( NoSuchMethodException e) {
+ } catch ( NoSuchMethodException e) {
throw new CannotActivateFactoryException("Can not activate the factory for "
+ implementationName + " because " + e.toString() );
- }
- catch ( SecurityException e) {
+ } catch ( SecurityException e) {
throw new CannotActivateFactoryException("Can not activate the factory for "
+ implementationName + " because " + e.toString() );
- }
- catch ( IllegalAccessException e ) {
+ } catch ( IllegalAccessException e ) {
throw new CannotActivateFactoryException("Can not activate the factory for "
+ implementationName + " because " + e.toString() );
}
catch ( IllegalArgumentException e ) {
throw new CannotActivateFactoryException("Can not activate the factory for "
+ implementationName + " because " + e.toString() );
- }
- catch ( InvocationTargetException e ) {
+ } catch ( InvocationTargetException e ) {
throw new CannotActivateFactoryException("Can not activate the factory for "
+ implementationName + " because " + e.getTargetException().toString() );
}
@@ -374,14 +362,18 @@ public class JavaLoader implements XImplementationLoader,
}
/**
- * Registers the component in a registry under a given root key. If the component supports the optional
- * methods __writeRegistryServiceInfo, writeRegistryServiceInfo (DEPRECATED), the call is delegated to that
- * method. Otherwise a default registration will be accomplished.
- * <p>
- * @return true if registration is successfully - otherwise false
+ * Registers the component in a registry under a given root key.
+ *
+ * <p>If the component supports the optional
+ * methods __writeRegistryServiceInfo, writeRegistryServiceInfo (DEPRECATED),
+ * the call is delegated to that method. Otherwise a default registration
+ * will be accomplished.</p>
+ *
* @param regKey the root key under that the component should be registred.
* @param implementationLoaderUrl specifies the loader, the component is loaded by.
- * @param locationUrl points to an archive (JAR file) which contains a component
+ * @param locationUrl points to an archive (JAR file) which contains a component.
+ * @return true if registration is successfully - otherwise false.
+ *
* @see ComponentFactoryWrapper
*/
public boolean writeRegistryInfo( XRegistryKey regKey,
@@ -398,10 +390,8 @@ public class JavaLoader implements XImplementationLoader,
Class<?> clazz = RegistrationClassFinder.find(locationUrl);
if (null == clazz)
- {
throw new CannotRegisterImplementationException(
"Cannot determine registration class!" );
- }
Class<?>[] paramTypes = { XRegistryKey.class };
Object[] params = { regKey };
@@ -411,8 +401,7 @@ public class JavaLoader implements XImplementationLoader,
if ( (oRet != null) && (oRet instanceof Boolean) )
success = ((Boolean) oRet).booleanValue();
- }
- catch (Exception e) {
+ } catch (Exception e) {
CannotRegisterImplementationException e2 =
new CannotRegisterImplementationException(e.toString());
e2.initCause(e);
@@ -423,12 +412,12 @@ public class JavaLoader implements XImplementationLoader,
}
/**
- * Supplies the factory for the <code>JavaLoader</code>
- * <p>
- * @return the factory for the <code>JavaLoader</code>
- * @param implName the name of the desired component
- * @param multiFactory the <code>ServiceManager</code> is delivered to the factory
- * @param regKey not used - can be null
+ * Supplies the factory for the <code>JavaLoader</code>.
+ *
+ * @param implName the name of the desired component.
+ * @param multiFactory the <code>ServiceManager</code> is delivered to the factory.
+ * @param regKey not used - can be null.
+ * @return the factory for the <code>JavaLoader</code>.
*/
public static XSingleServiceFactory getServiceFactory( String implName,
XMultiServiceFactory multiFactory,
@@ -442,9 +431,9 @@ public class JavaLoader implements XImplementationLoader,
/**
* Registers the <code>JavaLoader</code> at the registry.
- * <p>
- * @return true if registration succseeded - otherwise false
- * @param regKey root key under which the <code>JavaLoader</code> should be regidstered
+ *
+ * @param regKey root key under which the <code>JavaLoader</code> should be regidstered.
+ * @return true if registration succseeded - otherwise false.
*/
public static boolean writeRegistryServiceInfo(XRegistryKey regKey) {
boolean result = false;
@@ -452,12 +441,12 @@ public class JavaLoader implements XImplementationLoader,
try {
XRegistryKey newKey = regKey.createKey("/" + JavaLoader.class.getName() + "/UNO/SERVICE");
- for (int i=0; i<supportedServices.length; i++)
- newKey.createKey(supportedServices[i]);
+ for (String supportedService : supportedServices) {
+ newKey.createKey(supportedService);
+ }
result = true;
- }
- catch (Exception ex) {
+ } catch (Exception ex) {
if (DEBUG) System.err.println(">>>JavaLoader.writeRegistryServiceInfo " + ex);
}
diff --git a/jurt/com/sun/star/comp/loader/JavaLoaderFactory.java b/jurt/com/sun/star/comp/loader/JavaLoaderFactory.java
index 954cd66663d9..ce2d0f60162b 100644
--- a/jurt/com/sun/star/comp/loader/JavaLoaderFactory.java
+++ b/jurt/com/sun/star/comp/loader/JavaLoaderFactory.java
@@ -39,10 +39,6 @@ public class JavaLoaderFactory implements XSingleServiceFactory, XServiceInfo {
protected XMultiServiceFactory multiServiceFactory = null;
- /** default constructor
- */
-// public JavaLoaderFactory() {}
-
public JavaLoaderFactory(XMultiServiceFactory factory) {
multiServiceFactory = factory;
}
@@ -64,7 +60,8 @@ public class JavaLoaderFactory implements XSingleServiceFactory, XServiceInfo {
return loader;
}
- /** implements the XServiceInfo interface
+ /**
+ * Implements the XServiceInfo interface.
*/
public String getImplementationName()
throws com.sun.star.uno.RuntimeException
@@ -72,19 +69,22 @@ public class JavaLoaderFactory implements XSingleServiceFactory, XServiceInfo {
return JavaLoader.class.getName();
}
- /** implements the XServiceInfo interface
+ /**
+ * Implements the XServiceInfo interface.
*/
public boolean supportsService(String serviceName)
throws com.sun.star.uno.RuntimeException
{
- for ( int i = 0; i < supportedServices.length; i++ ) {
- if ( supportedServices[i].equals(serviceName) )
+ for (String supportedService : supportedServices) {
+ if (supportedService.equals(serviceName)) {
return true;
+ }
}
return false;
}
- /** implements the XServiceInfo interface
+ /**
+ * Implements the XServiceInfo interface.
*/
public String[] getSupportedServiceNames()
throws com.sun.star.uno.RuntimeException
diff --git a/jurt/com/sun/star/comp/servicemanager/ServiceManager.java b/jurt/com/sun/star/comp/servicemanager/ServiceManager.java
index dd595e77f6de..4424de1ec7b3 100644
--- a/jurt/com/sun/star/comp/servicemanager/ServiceManager.java
+++ b/jurt/com/sun/star/comp/servicemanager/ServiceManager.java
@@ -35,13 +35,14 @@ import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XComponentContext;
/**
- * The <code>ServiceManager</code> class is an implmentation of the <code>ServiceManager</code>the central class needed for
- * implementing or using UNO components in Java.
- * <p>
- * The Methods <code>queryInterface</code> and <code>isSame</code> delegate
- * calls to the implementing objects and are used instead of casts
- * and identity comparisons.
- * <p>
+ * The <code>ServiceManager</code> class is an implmentation of the
+ * <code>ServiceManager</code>the central class needed for implementing or using
+ * UNO components in Java.
+ *
+ * <p>The Methods <code>queryInterface</code> and <code>isSame</code> delegate
+ * calls to the implementing objects and are used instead of casts and identity
+ * comparisons.</p>
+ *
* @see com.sun.star.lang.XMultiServiceFactory
* @see com.sun.star.container.XSet
* @see com.sun.star.container.XContentEnumerationAccess
@@ -90,11 +91,14 @@ public class ServiceManager implements XMultiServiceFactory,
}
/**
- * Creates a new instance of a specified service. Therefor the associated factory of the service is
- * looked up and used to instanciate a new component.
- * <p>
- * @return newly created component
- * @param serviceSpecifier indicates the service or component name
+ * Creates a new instance of a specified service.
+ *
+ * <p>Therefor the associated factory of the service is looked up and used
+ * to instanciate a new component. </p>
+ *
+ * @param serviceSpecifier indicates the service or component name.
+ * @return newly created component.
+ *
* @see com.sun.star.lang.XMultiServiceFactory
*/
public java.lang.Object createInstance( String serviceSpecifier )
@@ -106,10 +110,12 @@ public class ServiceManager implements XMultiServiceFactory,
/**
* Creates a new instance of a specified service with the given parameters.
- * Therefor the associated factory of the service is looked up and used to instanciate a new component.
- * <p>
- * @return newly created component
- * @param serviceSpecifier indicates the service or component name
+ *
+ * <p>Therefor the associated factory of the service is looked up and used
+ * to instanciate a new component.</p>
+ *
+ * @return newly created component.
+ * @param serviceSpecifier indicates the service or component name.
* @see com.sun.star.lang.XMultiServiceFactory
*/
public java.lang.Object createInstanceWithArguments(
@@ -119,8 +125,9 @@ public class ServiceManager implements XMultiServiceFactory,
if (DEBUG) {
System.err.println("createInstanceWithArguments:" );
- for (int i=0; i<args.length; i++)
- System.err.print(" "+ args[i]);
+ for (Object arg : args) {
+ System.err.print(" " + arg);
+ }
System.err.println();
}
@@ -130,11 +137,14 @@ public class ServiceManager implements XMultiServiceFactory,
/**
* Look up the factory for a given service or implementation name.
- * First the requested service name is search in the list of avaible services. If it can not be found
- * the name is looked up in the implementation list.
- * <p>
- * @return the factory of the service / implementation
- * @param serviceName indicates the service or implementation name
+ *
+ * <p>First the requested service name is search in the list of avaible
+ * services. If it can not be found the name is looked up in the implementation
+ * list.</p>
+ *
+ * @param serviceName indicates the service or implementation name.
+ * @return the factory of the service / implementation.
+ *
* @see com.sun.star.lang.XMultiServiceFactory
*/
private Object queryServiceFactory(String serviceName)
@@ -171,8 +181,8 @@ public class ServiceManager implements XMultiServiceFactory,
/**
* Supplies a list of all avialable services names.
- * <p>
- * @return list of Strings of all service names
+ *
+ * @return list of Strings of all service names.
* @see com.sun.star.container.XContentEnumerationAccess
*/
public String[] getAvailableServiceNames()
@@ -192,11 +202,11 @@ public class ServiceManager implements XMultiServiceFactory,
// XMultiComponentFactory implementation
/** Create a service instance with given context.
-
- @param rServiceSpecifier service name
- @param xContext context
- @return service instance
- */
+ *
+ * @param rServiceSpecifier service name.
+ * @param xContext context.
+ * @return service instance.
+ */
public java.lang.Object createInstanceWithContext(
String rServiceSpecifier,
com.sun.star.uno.XComponentContext xContext )
@@ -231,13 +241,14 @@ public class ServiceManager implements XMultiServiceFactory,
}
return null;
}
- /** Create a service instance with given context and arguments.
-
- @param rServiceSpecifier service name
- @param rArguments arguments
- @param xContext context
- @return service instance
- */
+ /**
+ * Create a service instance with given context and arguments.
+ *
+ * @param rServiceSpecifier service name.
+ * @param rArguments arguments.
+ * @param xContext context.
+ * @return service instance.
+ */
public java.lang.Object createInstanceWithArgumentsAndContext(
String rServiceSpecifier,
java.lang.Object[] rArguments,
@@ -276,8 +287,9 @@ public class ServiceManager implements XMultiServiceFactory,
// public String[] getAvailableServiceNames();
/**
- * Removes all listeners from the <code>ServiceManager</code> and clears the list of the services.
- * <p>
+ * Removes all listeners from the <code>ServiceManager</code> and clears the
+ * list of the services.
+ *
* @see com.sun.star.lang.XComponent
*/
public void dispose()
@@ -298,11 +310,14 @@ public class ServiceManager implements XMultiServiceFactory,
}
/**
- * Adds a new <code>EventListener</code>. The listener is notified when a
- * service is added (removed) to (from) the <code>ServiceManager</code>.
- * If the listener is already registred a
- * <code>com.sun.star.uno.RuntimeException</code> will be thrown.
- * <p>
+ * Adds a new <code>EventListener</code>.
+ *
+ * <p>The listener is notified when a service is added (removed) to (from)
+ * the <code>ServiceManager</code>.</p>
+ *
+ * <p>If the listener is already registred a
+ * <code>com.sun.star.uno.RuntimeException</code> will be thrown.</p>
+ *
* @param xListener the new listener which should been added.
* @see com.sun.star.lang.XComponent
*/
@@ -320,11 +335,12 @@ public class ServiceManager implements XMultiServiceFactory,
/**
* Removes a <code>EventListener</code> from the <code>ServiceManager</code>.
- * If the listener is not registered a <code>com.sun.star.uno.RuntimeException</code>
- * will be thrown.
- * <p>
+ *
+ * <p>If the listener is not registered a <code>com.sun.star.uno.RuntimeException</code>
+ * will be thrown.</p>
+ *
* @param xListener the new listener which should been removed.
- * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.lang.XComponent
*/
public void removeEventListener( XEventListener xListener )
throws com.sun.star.uno.RuntimeException
@@ -339,29 +355,31 @@ public class ServiceManager implements XMultiServiceFactory,
}
/**
- * Checks if a component is registered at the <code>ServiceManager</code>. The given object argument must
- * provide a <code>XServiceInfo</code> interface.
- * <p>
- * @return true if the component is registred otherwise false.
+ * Checks if a component is registered at the <code>ServiceManager</code>.
+ *
+ * <p>The given object argument must provide a <code>XServiceInfo</code>
+ * interface.</p>
+ *
* @param object object which provides a <code>XServiceInfo</code> interface.
+ * @return true if the component is registred otherwise false.
+ *
* @see com.sun.star.container.XSet
* @see com.sun.star.lang.XServiceInfo
*/
public boolean has( Object object )
throws com.sun.star.uno.RuntimeException
{
- if (object == null)
- throw new com.sun.star.uno.RuntimeException("The parameter must not been null");
+ if (object == null)
+ throw new com.sun.star.uno.RuntimeException("The parameter must not been null");
- XServiceInfo xServiceInfo = UnoRuntime.queryInterface(XServiceInfo.class, object);
+ XServiceInfo xServiceInfo = UnoRuntime.queryInterface(XServiceInfo.class, object);
return xServiceInfo != null && UnoRuntime.areSame(factoriesByImplNames.get(xServiceInfo.getImplementationName()), object);
-
- }
+ }
/**
* Adds a <code>SingleServiceFactory</code> to the <code>ServiceManager</code>.
- * <p>
+ *
* @param object factory which should be added.
* @see com.sun.star.container.XSet
* @see com.sun.star.lang.XSingleServiceFactory
@@ -394,25 +412,24 @@ public class ServiceManager implements XMultiServiceFactory,
String[] serviceNames = xServiceInfo.getSupportedServiceNames();
ArrayList<Object> vec ;
- for (int i=0; i<serviceNames.length; i++) {
- if ( !factoriesByServiceNames.containsKey( serviceNames[i] ) ) {
- DEBUG("> no registered services found under " + serviceNames[i] + ": adding..." );
- factoriesByServiceNames.put(serviceNames[i], new ArrayList<Object>());
+ for (String serviceName : serviceNames) {
+ if (!factoriesByServiceNames.containsKey(serviceName)) {
+ DEBUG("> no registered services found under " + serviceName + ": adding...");
+ factoriesByServiceNames.put(serviceName, new ArrayList<Object>());
}
-
- vec = factoriesByServiceNames.get( serviceNames[i] );
-
- if ( vec.contains( object ) )
+ vec = factoriesByServiceNames.get(serviceName);
+ if (vec.contains( object )) {
System.err.println("The implementation " + xServiceInfo.getImplementationName() +
- " already registered for the service " + serviceNames[i] + " - ignoring!");
- else
+ " already registered for the service " + serviceName + " - ignoring!");
+ } else {
vec.add(object);
+ }
}
}
/**
* Removes a <code>SingleServiceFactory</code> from the <code>ServiceManager</code>.
- * <p>
+ *
* @param object factory which should be removed.
* @see com.sun.star.container.XSet
* @see com.sun.star.lang.XSingleServiceFactory
@@ -467,7 +484,7 @@ public class ServiceManager implements XMultiServiceFactory,
/**
* Provides an enumeration of all registered services.
- * <p>
+ *
* @return an enumeration of all available services.
* @see com.sun.star.container.XEnumerationAccess
*/
@@ -479,7 +496,7 @@ public class ServiceManager implements XMultiServiceFactory,
/**
* Provides the UNO type of the <code>ServiceManager</code>
- * <p>
+ *
* @return the UNO type of the <code>ServiceManager</code>.
* @see com.sun.star.container.XElementAccess
* @see com.sun.star.uno.TypeClass
@@ -495,7 +512,7 @@ public class ServiceManager implements XMultiServiceFactory,
/**
* Checks if the any componets are registered.
- * <p>
+ *
* @return true - if the list of the registred components is not empty - otherwise false.
* @see com.sun.star.container.XElementAccess
*/
@@ -505,9 +522,9 @@ public class ServiceManager implements XMultiServiceFactory,
/**
* Provides an enumeration of of all factorys for a specified service.
- * <p>
+ *
+ * @param serviceName name of the requested service.
* @return an enumeration for service name.
- * @param serviceName name of the requested service
* @see com.sun.star.container.XContentEnumerationAccess
*/
public XEnumeration createContentEnumeration( String serviceName )
@@ -527,7 +544,7 @@ public class ServiceManager implements XMultiServiceFactory,
/**
* Returns the implementation name of the <code>ServiceManager</code> component.
- * <p>
+ *
* @return the class name of the <code>ServiceManager</code>.
* @see com.sun.star.lang.XServiceInfo
*/
@@ -539,9 +556,10 @@ public class ServiceManager implements XMultiServiceFactory,
/**
* Checks if the <code>ServiceManager</code> supports a service.
- * <p>
- * @return true if the service is supported - otherwise false.
+ *
* @param serviceName service name which should be checked.
+ * @return true if the service is supported - otherwise false.
+ *
* @see com.sun.star.lang.XServiceInfo
*/
public boolean supportsService( String serviceName )
@@ -556,7 +574,7 @@ public class ServiceManager implements XMultiServiceFactory,
/**
* Supplies list of all supported services.
- * <p>
+ *
* @return a list of all supported service names.
* @see com.sun.star.lang.XServiceInfo
*/
@@ -569,8 +587,9 @@ public class ServiceManager implements XMultiServiceFactory,
/**
* The <code>ServiceEnumerationImpl</code> class provides an
* implementation of the @see com.sun.star.container.XEnumeration interface.
- * It is a inner wrapper for a java.util.Enumeration object.
- * <p>
+ *
+ * <p>It is a inner wrapper for a java.util.Enumeration object.</p>
+ *
* @see com.sun.star.lang.XSingleServiceFactory
* @see com.sun.star.lang.XServiceInfo
* @since UDK1.0
@@ -586,7 +605,7 @@ public class ServiceManager implements XMultiServiceFactory,
/**
* Constructs a new instance with a given enumeration.
- * <p>
+ *
* @param enumer is the enumeration which should been wrapped.
* @see com.sun.star.container.XEnumeration
*/
@@ -596,7 +615,7 @@ public class ServiceManager implements XMultiServiceFactory,
/**
* Constructs a new instance with a given enumeration.
- * <p>
+ *
* @param enumer is the enumeration which should been wrapped.
* @see com.sun.star.container.XEnumeration
*/
@@ -606,7 +625,7 @@ public class ServiceManager implements XMultiServiceFactory,
/**
* Checks if the enumeration contains more elements.
- * <p>
+ *
* @return true if more elements are available - otherwise false.
* @see com.sun.star.container.XEnumeration
*/
@@ -618,9 +637,11 @@ public class ServiceManager implements XMultiServiceFactory,
}
/**
- * Returns the next element of the enumeration. If no further elements
- * available a com.sun.star.container.NoSuchElementException exception will be thrown.
- * <p>
+ * Returns the next element of the enumeration.
+ *
+ * <p>If no further elements available a com.sun.star.container.NoSuchElementException
+ * exception will be thrown.</p>
+ *
* @return the next element.
* @see com.sun.star.container.XEnumeration
*/
diff --git a/jurt/com/sun/star/comp/urlresolver/UrlResolver.java b/jurt/com/sun/star/comp/urlresolver/UrlResolver.java
index 9b34e8c29b8b..cb90e355202c 100644
--- a/jurt/com/sun/star/comp/urlresolver/UrlResolver.java
+++ b/jurt/com/sun/star/comp/urlresolver/UrlResolver.java
@@ -41,7 +41,7 @@ import com.sun.star.uno.UnoRuntime;
/**
* This component gives a factory for an <code>UnoUrlResolver</code> service.
- * <p>
+ *
* @see com.sun.star.bridge.XBridgeFactory
* @see com.sun.star.connection.Connector
* @since UDK1.0
@@ -120,12 +120,14 @@ public class UrlResolver {
/**
* Gives a factory for creating the service.
- * This method is called by the <code>JavaLoader</code>
- * <p>
- * @return returns a <code>XSingleServiceFactory</code> for creating the component
- * @param implName the name of the implementation for which a service is desired
- * @param multiFactory the service manager to be uses if needed
- * @param regKey the registryKey
+ *
+ * <p>This method is called by the <code>JavaLoader</code>.</p>
+ *
+ * @param implName the name of the implementation for which a service is desired.
+ * @param multiFactory the service manager to be uses if needed.
+ * @param regKey the registryKey.
+ * @return returns a <code>XSingleServiceFactory</code> for creating the component.
+ *
* @see com.sun.star.comp.loader.JavaLoader
*/
public static XSingleServiceFactory __getServiceFactory(String implName,