[Libreoffice-commits] core.git: 2 commits - jurt/com
Michael Stahl
mstahl at redhat.com
Thu Jul 24 04:17:56 PDT 2014
jurt/com/sun/star/comp/bridgefactory/BridgeFactory.java | 60 -
jurt/com/sun/star/comp/connections/Acceptor.java | 5
jurt/com/sun/star/comp/connections/ConstantInstanceProvider.java | 24
jurt/com/sun/star/comp/connections/PipedConnection.java | 69 -
jurt/com/sun/star/comp/loader/FactoryHelper.java | 178 +--
jurt/com/sun/star/comp/loader/JavaLoader.java | 229 ++--
jurt/com/sun/star/comp/loader/JavaLoaderFactory.java | 18
jurt/com/sun/star/comp/servicemanager/ServiceManager.java | 193 ++--
jurt/com/sun/star/comp/urlresolver/UrlResolver.java | 16
jurt/com/sun/star/lib/connections/pipe/PipeConnection.java | 57 -
jurt/com/sun/star/lib/connections/pipe/pipeAcceptor.java | 7
jurt/com/sun/star/lib/connections/pipe/pipeConnector.java | 17
jurt/com/sun/star/lib/connections/socket/ConnectionDescriptor.java | 3
jurt/com/sun/star/lib/connections/socket/SocketConnection.java | 68 -
jurt/com/sun/star/lib/connections/socket/socketAcceptor.java | 5
jurt/com/sun/star/lib/connections/socket/socketConnector.java | 15
jurt/com/sun/star/lib/uno/bridges/java_remote/BridgedObject.java | 4
jurt/com/sun/star/lib/uno/bridges/java_remote/XConnectionInputStream_Adapter.java | 10
jurt/com/sun/star/lib/uno/bridges/java_remote/XConnectionOutputStream_Adapter.java | 16
jurt/com/sun/star/lib/uno/bridges/java_remote/java_remote_bridge.java | 102 +-
jurt/com/sun/star/lib/uno/environments/java/java_environment.java | 30
jurt/com/sun/star/lib/uno/environments/remote/IProtocol.java | 20
jurt/com/sun/star/lib/uno/environments/remote/IThreadPool.java | 68 -
jurt/com/sun/star/lib/uno/environments/remote/JavaThreadPool.java | 2
jurt/com/sun/star/lib/uno/environments/remote/Job.java | 15
jurt/com/sun/star/lib/uno/environments/remote/JobQueue.java | 76 -
jurt/com/sun/star/lib/uno/environments/remote/Message.java | 162 +--
jurt/com/sun/star/lib/uno/environments/remote/ThreadId.java | 24
jurt/com/sun/star/lib/uno/environments/remote/ThreadPoolManager.java | 4
jurt/com/sun/star/lib/uno/protocols/urp/Cache.java | 20
jurt/com/sun/star/lib/uno/protocols/urp/urp.java | 34
jurt/com/sun/star/lib/util/AsynchronousFinalizer.java | 51 -
jurt/com/sun/star/lib/util/NativeLibraryLoader.java | 60 -
jurt/com/sun/star/lib/util/StringHelper.java | 3
jurt/com/sun/star/lib/util/UrlToFileMapper.java | 2
jurt/com/sun/star/uno/AnyConverter.java | 476 ++++++----
jurt/com/sun/star/uno/Ascii.java | 10
jurt/com/sun/star/uno/AsciiString.java | 10
jurt/com/sun/star/uno/MappingException.java | 16
jurt/com/sun/star/uno/WeakReference.java | 57 -
40 files changed, 1221 insertions(+), 1015 deletions(-)
New commits:
commit c9e61e02b36def2c139c122df8e7c59041d22f13
Author: Michael Stahl <mstahl at redhat.com>
Date: Thu Jul 24 13:13:20 2014 +0200
typos
Change-Id: I3da5c0c1e9c7ecbb69463e948ac0eb326b112767
diff --git a/jurt/com/sun/star/comp/loader/JavaLoader.java b/jurt/com/sun/star/comp/loader/JavaLoader.java
index bfcb670..708a2ee 100644
--- a/jurt/com/sun/star/comp/loader/JavaLoader.java
+++ b/jurt/com/sun/star/comp/loader/JavaLoader.java
@@ -140,7 +140,7 @@ public class JavaLoader implements XImplementationLoader,
* 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
+ * the <code>ServiceManager</code> service which can be delivered to all
* components the <code>JavaLoader</code> is loading.</p>
*
* <p>To set the <code>MultiServiceFactory</code> you can use the
diff --git a/jurt/com/sun/star/comp/servicemanager/ServiceManager.java b/jurt/com/sun/star/comp/servicemanager/ServiceManager.java
index 4424de1..8def4ac 100644
--- a/jurt/com/sun/star/comp/servicemanager/ServiceManager.java
+++ b/jurt/com/sun/star/comp/servicemanager/ServiceManager.java
@@ -138,7 +138,7 @@ public class ServiceManager implements XMultiServiceFactory,
/**
* Look up the factory for a given service or implementation name.
*
- * <p>First the requested service name is search in the list of avaible
+ * <p>First the requested service name is search in the list of available
* services. If it can not be found the name is looked up in the implementation
* list.</p>
*
commit b01358553082fd6f30781d0641c652f206c90c63
Author: rbuj <robert.buj at gmail.com>
Date: Wed Jul 23 18:51:20 2014 +0200
jurt: Enhanced For-Loops, code formatting, javadoc & overrides
Signed-off-by: Michael Stahl <mstahl at redhat.com>
Conflicts:
jurt/com/sun/star/lib/uno/environments/remote/JobQueue.java
Change-Id: I6d6324c5597fa472360a1b8bb4153dec647a36f0
diff --git a/jurt/com/sun/star/comp/bridgefactory/BridgeFactory.java b/jurt/com/sun/star/comp/bridgefactory/BridgeFactory.java
index 9d3920e..7e370a9 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 cc7ce76..7c8e0e9 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 95f3016..687f70e 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 12f1895..d48b2a6 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 861f4e9..191aa1d 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 98df09b..bfcb670 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 954cd66..ce2d0f6 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 dd595e7..4424de1 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 9b34e8c..cb90e35 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,
diff --git a/jurt/com/sun/star/lib/connections/pipe/PipeConnection.java b/jurt/com/sun/star/lib/connections/pipe/PipeConnection.java
index 5f1bcb4..62c4e23 100644
--- a/jurt/com/sun/star/lib/connections/pipe/PipeConnection.java
+++ b/jurt/com/sun/star/lib/connections/pipe/PipeConnection.java
@@ -31,7 +31,7 @@ import com.sun.star.lib.util.NativeLibraryLoader;
* The PipeConnection implements the <code>XConnection</code> interface
* and is uses by the <code>PipeConnector</code> and the <code>PipeAcceptor</code>.
* This class is not part of the provided <code>api</code>.
- * <p>
+ *
* @see com.sun.star.lib.connections.pipe.pipeAcceptor
* @see com.sun.star.lib.connections.pipe.pipeConnector
* @see com.sun.star.connection.XConnection
@@ -55,8 +55,8 @@ public class PipeConnection implements XConnection, XConnectionBroadcaster {
/**
* Constructs a new <code>PipeConnection</code>.
- * <p>
- * @param description the description of the connection
+ *
+ * @param description the description of the connection.
*/
public PipeConnection(String description)
throws IOException
@@ -69,8 +69,7 @@ public class PipeConnection implements XConnection, XConnectionBroadcaster {
// get pipe name from pipe descriptor
String aPipeName ;
StringTokenizer aTokenizer = new StringTokenizer( description, "," );
- if ( aTokenizer.hasMoreTokens() )
- {
+ if ( aTokenizer.hasMoreTokens() ) {
String aConnType = aTokenizer.nextToken();
if ( !aConnType.equals( "pipe" ) )
throw new RuntimeException( "invalid pipe descriptor: does not start with 'pipe,'" );
@@ -79,19 +78,20 @@ public class PipeConnection implements XConnection, XConnectionBroadcaster {
if ( !aPipeNameParam.substring( 0, 5 ).equals( "name=" ) )
throw new RuntimeException( "invalid pipe descriptor: no 'name=' parameter found" );
aPipeName = aPipeNameParam.substring( 5 );
- }
+ }
else
throw new RuntimeException( "invalid or empty pipe descriptor" );
// create the pipe
- try
- { createJNI( aPipeName ); }
- catch ( java.lang.NullPointerException aNPE )
- { throw new IOException( aNPE.getMessage() ); }
- catch ( com.sun.star.io.IOException aIOE )
- { throw new IOException( aIOE.getMessage() ); }
- catch ( java.lang.Exception aE )
- { throw new IOException( aE.getMessage() ); }
+ try {
+ createJNI( aPipeName );
+ } catch ( java.lang.NullPointerException aNPE ) {
+ throw new IOException( aNPE.getMessage() );
+ } catch ( com.sun.star.io.IOException aIOE ) {
+ throw new IOException( aIOE.getMessage() );
+ } catch ( java.lang.Exception aE ) {
+ throw new IOException( aE.getMessage() );
+ }
}
public void addStreamListener(XStreamListener aListener ) throws com.sun.star.uno.RuntimeException {
@@ -148,11 +148,12 @@ public class PipeConnection implements XConnection, XConnectionBroadcaster {
/**
* Read the required number of bytes.
- * <p>
- * @return the number of bytes read
- * @param bytes the outparameter, where the bytes have to be placed
- * @param nBytesToRead the number of bytes to read
- * @see com.sun.star.connection.XConnection#read
+ *
+ * @param bytes the outparameter, 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 int read(/*OUT*/byte[][] bytes, int nBytesToRead)
throws com.sun.star.io.IOException, com.sun.star.uno.RuntimeException
@@ -168,9 +169,9 @@ public class PipeConnection implements XConnection, XConnectionBroadcaster {
/**
* 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
@@ -180,8 +181,8 @@ public class PipeConnection implements XConnection, XConnectionBroadcaster {
/**
* Flushes the buffer.
- * <p>
- * @see com.sun.star.connection.XConnection#flush
+ *
+ * @see com.sun.star.connection.XConnection#flush
*/
public void flush()
throws com.sun.star.io.IOException, com.sun.star.uno.RuntimeException
@@ -191,7 +192,7 @@ public class PipeConnection implements XConnection, XConnectionBroadcaster {
/**
* Closes the connection.
- * <p>
+ *
* @see com.sun.star.connection.XConnection#close
*/
public void close()
@@ -205,9 +206,9 @@ public class PipeConnection implements XConnection, XConnectionBroadcaster {
/**
* Gives a description of the connection.
- * <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 _aDescription;
diff --git a/jurt/com/sun/star/lib/connections/pipe/pipeAcceptor.java b/jurt/com/sun/star/lib/connections/pipe/pipeAcceptor.java
index e483c89..5d2a7d5 100644
--- a/jurt/com/sun/star/lib/connections/pipe/pipeAcceptor.java
+++ b/jurt/com/sun/star/lib/connections/pipe/pipeAcceptor.java
@@ -108,13 +108,16 @@ public final class pipeAcceptor implements XAcceptor {
AlreadyAcceptingException, ConnectionSetupException,
com.sun.star.lang.IllegalArgumentException
{
- throw new java.lang.NoSuchMethodError( "pipeAcceptor not fully implemented yet" );
+ throw new java.lang.NoSuchMethodError( "pipeAcceptor not fully implemented yet" );
//try { return new PipeConnection( connectionDescription ); }
//catch ( java.io.IOException e ) { return null; }
}
- // see com.sun.star.connection.XAcceptor#stopAccepting
+ /**
+ *
+ * @see com.sun.star.connection.XAcceptor#stopAccepting
+ */
public void stopAccepting() {
}
diff --git a/jurt/com/sun/star/lib/connections/pipe/pipeConnector.java b/jurt/com/sun/star/lib/connections/pipe/pipeConnector.java
index 57a0d05..425128c 100644
--- a/jurt/com/sun/star/lib/connections/pipe/pipeConnector.java
+++ b/jurt/com/sun/star/lib/connections/pipe/pipeConnector.java
@@ -101,17 +101,16 @@ public final class pipeConnector implements XConnector {
public synchronized XConnection connect(String connectionDescription)
throws NoConnectException, ConnectionSetupException
{
- if (bConnected) {
+ if (bConnected)
throw new ConnectionSetupException("alread connected");
- }
- try
- {
- XConnection xConn = new PipeConnection( connectionDescription );
- bConnected = true;
- return xConn;
- }
- catch ( java.io.IOException e ) { throw new NoConnectException(); }
+ try {
+ XConnection xConn = new PipeConnection( connectionDescription );
+ bConnected = true;
+ return xConn;
+ } catch ( java.io.IOException e ) {
+ throw new NoConnectException();
+ }
}
private boolean bConnected = false;
diff --git a/jurt/com/sun/star/lib/connections/socket/ConnectionDescriptor.java b/jurt/com/sun/star/lib/connections/socket/ConnectionDescriptor.java
index 82b0c7c..f362dac 100644
--- a/jurt/com/sun/star/lib/connections/socket/ConnectionDescriptor.java
+++ b/jurt/com/sun/star/lib/connections/socket/ConnectionDescriptor.java
@@ -19,8 +19,7 @@
package com.sun.star.lib.connections.socket;
/**
- * Helper class for <code>socketAcceptor</code> and
- * <code>socketConnector</code>.
+ * Helper class for <code>socketAcceptor</code> and <code>socketConnector</code>.
*
* <p>FIXME: Once those classes have been moved from <code>jurt</code> to
* <code>javaunohelper</code>, they should use
diff --git a/jurt/com/sun/star/lib/connections/socket/SocketConnection.java b/jurt/com/sun/star/lib/connections/socket/SocketConnection.java
index 8e878ee..e849d8b 100644
--- a/jurt/com/sun/star/lib/connections/socket/SocketConnection.java
+++ b/jurt/com/sun/star/lib/connections/socket/SocketConnection.java
@@ -34,8 +34,9 @@ import com.sun.star.io.XStreamListener;
/**
* The SocketConnection implements the <code>XConnection</code> interface
* and is uses by the <code>SocketConnector</code> and the <code>SocketAcceptor</code>.
- * This class is not part of the provided <code>api</code>.
- * <p>
+ *
+ * <p>This class is not part of the provided <code>api</code>.</p>
+ *
* @see com.sun.star.lib.connections.socket.socketAcceptor
* @see com.sun.star.lib.connections.socket.socketConnector
* @see com.sun.star.connection.XConnection
@@ -56,9 +57,9 @@ public class SocketConnection implements XConnection, XConnectionBroadcaster {
/**
* Constructs a new <code>SocketConnection</code>.
- * <p>
- * @param description the description of the connection
- * @param socket the socket of the connection
+ *
+ * @param description the description of the connection.
+ * @param socket the socket of the connection.
*/
public SocketConnection(String description, Socket socket) throws IOException {
if (DEBUG) System.err.println("##### " + getClass().getName() + " - instantiated " + description + " " + socket);
@@ -77,14 +78,13 @@ public class SocketConnection implements XConnection, XConnectionBroadcaster {
_firstRead = true;
}
-
-
-
- public void addStreamListener(XStreamListener aListener ) throws com.sun.star.uno.RuntimeException {
+ public void addStreamListener(XStreamListener aListener )
+ throws com.sun.star.uno.RuntimeException {
_listeners.add(aListener);
}
- public void removeStreamListener(XStreamListener aListener ) throws com.sun.star.uno.RuntimeException {
+ public void removeStreamListener(XStreamListener aListener )
+ throws com.sun.star.uno.RuntimeException {
_listeners.remove(aListener);
}
@@ -112,16 +112,17 @@ public class SocketConnection implements XConnection, XConnectionBroadcaster {
}
}
-
/**
* Read the required number of bytes.
- * <p>
- * @return the number of bytes read
- * @param bytes the outparameter, where the bytes have to be placed
- * @param nBytesToRead the number of bytes to read
- * @see com.sun.star.connection.XConnection#read
+ *
+ * @param bytes the outparameter, 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 int read(/*OUT*/byte[][] bytes, int nBytesToRead) throws com.sun.star.io.IOException, com.sun.star.uno.RuntimeException {
+ public int read(/*OUT*/byte[][] bytes, int nBytesToRead)
+ throws com.sun.star.io.IOException, com.sun.star.uno.RuntimeException {
if(_firstRead) {
_firstRead = false;
@@ -144,8 +145,7 @@ public class SocketConnection implements XConnection, XConnectionBroadcaster {
read_bytes += count;
}
while(read_bytes >= 0 && read_bytes < nBytesToRead && count >= 0);
- }
- catch(IOException ioException) {
+ } catch(IOException ioException) {
if(DEBUG) {
System.err.println("##### " + getClass().getName() + ".read - exception occurred:" + ioException);
ioException.printStackTrace();
@@ -168,15 +168,15 @@ public class SocketConnection implements XConnection, XConnectionBroadcaster {
/**
* Write bytes.
- * <p>
- * @param aData the bytes to 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 {
+ public void write(byte aData[]) throws com.sun.star.io.IOException,
+ com.sun.star.uno.RuntimeException {
try {
_outputStream.write(aData);
- }
- catch(IOException ioException) {
+ } catch(IOException ioException) {
com.sun.star.io.IOException unoIOException = new com.sun.star.io.IOException(ioException.toString());
notifyListeners_error(unoIOException);
@@ -188,14 +188,14 @@ public class SocketConnection implements XConnection, XConnectionBroadcaster {
/**
* Flushes the buffer.
- * <p>
+ *
* @see com.sun.star.connection.XConnection#flush
*/
- public void flush() throws com.sun.star.io.IOException, com.sun.star.uno.RuntimeException {
+ public void flush() throws com.sun.star.io.IOException,
+ com.sun.star.uno.RuntimeException {
try {
_outputStream.flush();
- }
- catch(IOException ioException) {
+ } catch(IOException ioException) {
com.sun.star.io.IOException unoIOException = new com.sun.star.io.IOException(ioException.toString());
notifyListeners_error(unoIOException);
@@ -205,14 +205,14 @@ public class SocketConnection implements XConnection, XConnectionBroadcaster {
/**
* Closes the connection.
- * <p>
+ *
* @see com.sun.star.connection.XConnection#close
*/
- public void close() throws com.sun.star.io.IOException, com.sun.star.uno.RuntimeException {
+ public void close() throws com.sun.star.io.IOException,
+ com.sun.star.uno.RuntimeException {
try {
_socket.close();
- }
- catch(IOException ioException) {
+ } catch(IOException ioException) {
com.sun.star.io.IOException unoIOException = new com.sun.star.io.IOException(ioException.toString());
notifyListeners_error(unoIOException);
@@ -225,8 +225,8 @@ public class SocketConnection implements XConnection, XConnectionBroadcaster {
/**
* Gives a description of the connection.
- * <p>
- * @return the description
+ *
+ * @return the description.
* @see com.sun.star.connection.XConnection#getDescription
*/
public String getDescription() throws com.sun.star.uno.RuntimeException {
diff --git a/jurt/com/sun/star/lib/connections/socket/socketAcceptor.java b/jurt/com/sun/star/lib/connections/socket/socketAcceptor.java
index 32f0f20..22dbfa4 100644
--- a/jurt/com/sun/star/lib/connections/socket/socketAcceptor.java
+++ b/jurt/com/sun/star/lib/connections/socket/socketAcceptor.java
@@ -161,7 +161,10 @@ public final class socketAcceptor implements XAcceptor {
}
}
- // see com.sun.star.connection.XAcceptor#stopAccepting
+ /**
+ *
+ * @see com.sun.star.connection.XAcceptor#stopAccepting
+ */
public void stopAccepting() {
ServerSocket serv;
synchronized (this) {
diff --git a/jurt/com/sun/star/lib/connections/socket/socketConnector.java b/jurt/com/sun/star/lib/connections/socket/socketConnector.java
index 74fb169..48d87b7 100644
--- a/jurt/com/sun/star/lib/connections/socket/socketConnector.java
+++ b/jurt/com/sun/star/lib/connections/socket/socketConnector.java
@@ -106,18 +106,18 @@ public final class socketConnector implements XConnector {
public synchronized XConnection connect(String connectionDescription)
throws NoConnectException, ConnectionSetupException
{
- if (connected) {
+ if (connected)
throw new ConnectionSetupException("alread connected");
- }
+
ConnectionDescriptor desc;
try {
desc = new ConnectionDescriptor(connectionDescription);
} catch (com.sun.star.lang.IllegalArgumentException e) {
throw new ConnectionSetupException(e.toString());
}
- if (desc.getHost() == null) {
+
+ if (desc.getHost() == null)
throw new ConnectionSetupException("host parameter missing");
- }
// Try all (IPv4 and IPv6) addresses, in case this client is on a
// dual-stack host and the server process is an IPv4-only process, also
// on a dual-stack host (see Stevens, Fenner, Rudoff: "Unix Network
@@ -135,16 +135,15 @@ public final class socketConnector implements XConnector {
socket = new Socket(adr[i], desc.getPort());
break;
} catch (IOException e) {
- if (i == adr.length - 1) {
+ if (i == adr.length - 1)
throw new NoConnectException(e.toString());
- }
}
}
XConnection con;
try {
- if (desc.getTcpNoDelay() != null) {
+ if (desc.getTcpNoDelay() != null)
socket.setTcpNoDelay(desc.getTcpNoDelay().booleanValue());
- }
+
con = new SocketConnection(connectionDescription, socket);
} catch (IOException e) {
throw new NoConnectException(e.toString());
diff --git a/jurt/com/sun/star/lib/uno/bridges/java_remote/BridgedObject.java b/jurt/com/sun/star/lib/uno/bridges/java_remote/BridgedObject.java
index 776296d..639e9f6 100644
--- a/jurt/com/sun/star/lib/uno/bridges/java_remote/BridgedObject.java
+++ b/jurt/com/sun/star/lib/uno/bridges/java_remote/BridgedObject.java
@@ -28,9 +28,9 @@ public final class BridgedObject {
* Obtains the bridge associated with a bridged object.
*
* @param obj a reference to a (Java representation of a) UNO object;
- * must not be null
+ * must not be null.
* @return the bridge associated with the given object, if it is indeed
- * bridged; otherwise, null is returned
+ * bridged; otherwise, null is returned.
*/
public static XBridge getBridge(Object obj) {
return ProxyFactory.getBridge(obj);
diff --git a/jurt/com/sun/star/lib/uno/bridges/java_remote/XConnectionInputStream_Adapter.java b/jurt/com/sun/star/lib/uno/bridges/java_remote/XConnectionInputStream_Adapter.java
index 1d45cb9..a189115 100644
--- a/jurt/com/sun/star/lib/uno/bridges/java_remote/XConnectionInputStream_Adapter.java
+++ b/jurt/com/sun/star/lib/uno/bridges/java_remote/XConnectionInputStream_Adapter.java
@@ -40,13 +40,11 @@ class XConnectionInputStream_Adapter extends InputStream {
}
public int read() throws IOException {
-
- int len ;
+ int len;
try {
len = _xConnection.read(_bytes, 1);
- }
- catch(com.sun.star.io.IOException ioException) {
+ } catch(com.sun.star.io.IOException ioException) {
throw new IOException(ioException.toString());
}
@@ -55,13 +53,13 @@ class XConnectionInputStream_Adapter extends InputStream {
return len == 0 ? -1 : _bytes[0][0] & 0xff;
}
+ @Override
public int read(byte[] b, int off, int len) throws IOException {
// byte bytes[][] = new byte[1][];
try {
len = _xConnection.read(_bytes, len - off);
- }
- catch(com.sun.star.io.IOException ioException) {
+ } catch(com.sun.star.io.IOException ioException) {
throw new IOException(ioException.toString());
}
diff --git a/jurt/com/sun/star/lib/uno/bridges/java_remote/XConnectionOutputStream_Adapter.java b/jurt/com/sun/star/lib/uno/bridges/java_remote/XConnectionOutputStream_Adapter.java
index 999970e..3bc7e49 100644
--- a/jurt/com/sun/star/lib/uno/bridges/java_remote/XConnectionOutputStream_Adapter.java
+++ b/jurt/com/sun/star/lib/uno/bridges/java_remote/XConnectionOutputStream_Adapter.java
@@ -42,21 +42,20 @@ class XConnectionOutputStream_Adapter extends OutputStream {
try {
_xConnection.write(_bytes);
- }
- catch(com.sun.star.io.IOException ioException) {
+ } catch(com.sun.star.io.IOException ioException) {
throw new IOException(ioException.toString());
}
if(DEBUG) System.err.println("#### " + this.getClass() + " - one byte written:" + _bytes[0]);
}
+ @Override
public void write(byte[] b, int off, int len) throws IOException {
byte bytes[] ;
- if(off == 0 && len == b.length)
+ if(off == 0 && len == b.length) {
bytes = b;
-
- else {
+ } else {
bytes = new byte[len];
System.arraycopy(b, off, bytes, 0, len);
@@ -64,17 +63,16 @@ class XConnectionOutputStream_Adapter extends OutputStream {
try {
_xConnection.write(bytes);
- }
- catch(com.sun.star.io.IOException ioException) {
+ } catch(com.sun.star.io.IOException ioException) {
throw new IOException(ioException.toString());
}
}
+ @Override
public void flush() throws IOException {
try {
_xConnection.flush();
- }
- catch(com.sun.star.io.IOException ioException) {
+ } catch(com.sun.star.io.IOException ioException) {
throw new IOException(ioException.toString());
}
}
diff --git a/jurt/com/sun/star/lib/uno/bridges/java_remote/java_remote_bridge.java b/jurt/com/sun/star/lib/uno/bridges/java_remote/java_remote_bridge.java
index 841cd7c..4f76c5c 100644
--- a/jurt/com/sun/star/lib/uno/bridges/java_remote/java_remote_bridge.java
+++ b/jurt/com/sun/star/lib/uno/bridges/java_remote/java_remote_bridge.java
@@ -22,7 +22,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
-
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
@@ -63,12 +62,13 @@ import com.sun.star.uno.TypeClass;
import com.sun.star.uno.Any;
/**
- * This class implements a remote bridge. Therefor
- * various interfaces are implemented.
- * <p>
- * The protocol to used is passed by name, the bridge
- * then looks for it under <code>com.sun.star.lib.uno.protocols</code>.
- * <p>
+ * This class implements a remote bridge.
+ *
+ * <p>Therefor various interfaces are implemented.</p>
+ *
+ * <p>The protocol to used is passed by name, the bridge
+ * then looks for it under <code>com.sun.star.lib.uno.protocols</code>.</p>
+ *
* @since UDK1.0
*/
public class java_remote_bridge
@@ -185,10 +185,13 @@ public class java_remote_bridge
return _iProtocol;
}
- // The ref holder stuff strongly holds objects mapped out via this bridge
- // (the java_environment only holds them weakly). When this bridge is
- // disposed, all remaining ref holder entries are released.
-
+ /**
+ * The ref holder stuff strongly holds objects mapped out via this bridge
+ * (the java_environment only holds them weakly).
+ *
+ * <p>When this bridge is disposed, all remaining ref holder entries are
+ * released.</p>
+ */
private static final class RefHolder {
public RefHolder(Type type, Object object) {
this.type = type;
@@ -219,8 +222,7 @@ public class java_remote_bridge
synchronized (refHolders) {
LinkedList<RefHolder> l = refHolders.get(oid);
if (l != null) {
- for (Iterator<RefHolder> i = l.iterator(); i.hasNext();) {
- RefHolder rh = i.next();
+ for (RefHolder rh : l) {
if (type.isSupertypeOf(rh.getType())) {
return true;
}
@@ -256,8 +258,7 @@ public class java_remote_bridge
synchronized (refHolders) {
LinkedList<RefHolder> l = refHolders.get(oid);
if (l != null) {
- for (Iterator<RefHolder> i = l.iterator(); i.hasNext();) {
- RefHolder rh = i.next();
+ for (RefHolder rh : l) {
if (rh.getType().equals(type)) {
try {
if (rh.release()) {
@@ -353,19 +354,22 @@ public class java_remote_bridge
/**
* Constructs a new bridge.
- * <p>
- * This method is not part of the provided <code>api</code>
- * and should only be used by the UNO runtime.
- * <p>
+ * <p> This method is not part of the provided <code>api</code>
+ * and should only be used by the UNO runtime.</p>
+ *
+ * @param args the custom parameters: arg[0] == protocol_name,
+ * arg[1] == xConnection, arg[2] == xInstanceProvider.
+ *
* @deprecated as of UDK 1.0
- * <p>
- * @param args the custom parameters: arg[0] == protocol_name, arg[1] == xConnection, arg[2] == xInstanceProvider
*/
public java_remote_bridge(Object args[]) throws Exception {
this(UnoRuntime.getEnvironment("java", null), UnoRuntime.getEnvironment("remote", null), args);
}
- // @see com.sun.star.uno.IBridge#mapInterfaceTo
+ /**
+ *
+ * @see com.sun.star.uno.IBridge#mapInterfaceTo
+ */
public Object mapInterfaceTo(Object object, Type type) {
checkDisposed();
if (object == null) {
@@ -397,10 +401,11 @@ public class java_remote_bridge
/**
* Maps an object from destination environment to the source environment.
- * <p>
- * @return the object in the source environment
- * @param oId the object to map
- * @param type the interface under which is to be mapped
+ *
+ * @param oId the object to map.
+ * @param type the interface under which is to be mapped.
+ * @return the object in the source environment.
+ *
* @see com.sun.star.uno.IBridge#mapInterfaceFrom
*/
public Object mapInterfaceFrom(Object oId, Type type) {
@@ -423,8 +428,8 @@ public class java_remote_bridge
/**
* Gives the source environment.
- * <p>
- * @return the source environment of this bridge
+ *
+ * @return the source environment of this bridge.
* @see com.sun.star.uno.IBridge#getSourceEnvironment
*/
public IEnvironment getSourceEnvironment() {
@@ -433,8 +438,8 @@ public class java_remote_bridge
/**
* Gives the destination environment.
- * <p>
- * @return the destination environment of this bridge
+ *
+ * @return the destination environment of this bridge.
* @see com.sun.star.uno.IBridge#getTargetEnvironment
*/
public IEnvironment getTargetEnvironment() {
@@ -443,7 +448,7 @@ public class java_remote_bridge
/**
* Increases the life count.
- * <p>
+ *
* @see com.sun.star.uno.IBridge#acquire
*/
public synchronized void acquire() {
@@ -454,8 +459,9 @@ public class java_remote_bridge
/**
* Decreases the life count.
- * If the life count drops to zero, the bridge disposes itself.
- * <p>
+ *
+ * <p>If the life count drops to zero, the bridge disposes itself.</p>
+ *
* @see com.sun.star.uno.IBridge#release
*/
public void release() {
@@ -552,7 +558,10 @@ public class java_remote_bridge
}
}
- // @see com.sun.star.bridge.XBridge#getInstance
+ /**
+ *
+ * @see com.sun.star.bridge.XBridge#getInstance
+ */
public Object getInstance(String instanceName) {
Type t = new Type(XInterface.class);
return sendInternalRequest(
@@ -560,9 +569,9 @@ public class java_remote_bridge
}
/**
- * Gives the name of this bridge
- * <p>
- * @return the name of this bridge
+ * Gives the name of this bridge.
+ *
+ * @return the name of this bridge.
* @see com.sun.star.bridge.XBridge#getName
*/
public String getName() {
@@ -570,9 +579,9 @@ public class java_remote_bridge
}
/**
- * Gives a description of the connection type and protocol used
- * <p>
- * @return connection type and protocol
+ * Gives a description of the connection type and protocol used.
+ *
+ * @return connection type and protocol.
* @see com.sun.star.bridge.XBridge#getDescription
*/
public String getDescription() {
@@ -664,7 +673,9 @@ public class java_remote_bridge
}
}
- // Methods XComponent
+ /**
+ * Methods XComponent.
+ */
public void addEventListener(XEventListener xEventListener) {
_listeners.add(xEventListener);
}
@@ -673,7 +684,10 @@ public class java_remote_bridge
_listeners.remove(xEventListener);
}
- // @see NotifyDispose.addDisposeListener
+ /**
+ *
+ * @see NotifyDispose.addDisposeListener
+ */
public void addDisposeListener(DisposeListener listener) {
synchronized (this) {
if (!disposed) {
@@ -684,7 +698,9 @@ public class java_remote_bridge
listener.notifyDispose(this);
}
- // This function must only be called while synchronized on this object:
+ /**
+ * This function must only be called while synchronized on this object.
+ */
private synchronized void checkDisposed() {
if (disposed) {
throw new DisposedException("java_remote_bridge " + this
diff --git a/jurt/com/sun/star/lib/uno/environments/java/java_environment.java b/jurt/com/sun/star/lib/uno/environments/java/java_environment.java
index 522ca8c..e02f0ce 100644
--- a/jurt/com/sun/star/lib/uno/environments/java/java_environment.java
+++ b/jurt/com/sun/star/lib/uno/environments/java/java_environment.java
@@ -43,17 +43,26 @@ public final class java_environment implements IEnvironment {
this.context = context;
}
- // @see com.sun.star.uno.IEnvironment#getContext
+ /**
+ *
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list