de.init.service
Class UnoServiceManager

java.lang.Object
  extended by de.init.service.UnoServiceManager

public class UnoServiceManager
extends java.lang.Object

Wrapper class for UNO services and interfaces

Author:
mkandora

Method Summary
 java.lang.Object getService(java.lang.String serviceName)
          Queries the XComponentContext for a given service The XMultiServiceFactory from XComponentContext.getServiceManager() will be used to create new services
 java.lang.Object getService(java.lang.String serviceName, com.sun.star.lang.XMultiServiceFactory serviceFactory)
           
static UnoServiceManager getServiceManager(com.sun.star.uno.XComponentContext... context)
          Obtains a singleton instance of a UnoServiceManager using the context
<T extends com.sun.star.uno.XInterface>
T
query(java.lang.Class<T> clazz, java.lang.Object context)
          Queries the UnoRuntime for provided Interface on provided context
<T extends com.sun.star.uno.XInterface>
T
queryWithDefaultContext(java.lang.Class<T> clazz)
          Queries the UnoRuntime for provided Interface on standard XComponentContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getServiceManager

public static UnoServiceManager getServiceManager(com.sun.star.uno.XComponentContext... context)
Obtains a singleton instance of a UnoServiceManager using the context

Parameters:
context -
Returns:

queryWithDefaultContext

public final <T extends com.sun.star.uno.XInterface> T queryWithDefaultContext(java.lang.Class<T> clazz)
Queries the UnoRuntime for provided Interface on standard XComponentContext

Parameters:
clazz - the XInterface to query the standard XComponentContext for
Returns:
the XInterface

query

public final <T extends com.sun.star.uno.XInterface> T query(java.lang.Class<T> clazz,
                                                             java.lang.Object context)
Queries the UnoRuntime for provided Interface on provided context

Parameters:
clazz - the XInterface to query the standard XComponentContext for
context - a context to query the runtime for interfaces
Returns:
the XInterface

getService

public final java.lang.Object getService(java.lang.String serviceName)
                                  throws java.lang.Exception
Queries the XComponentContext for a given service The XMultiServiceFactory from XComponentContext.getServiceManager() will be used to create new services

Parameters:
serviceName -
Returns:
Throws:
java.lang.Exception

getService

public final java.lang.Object getService(java.lang.String serviceName,
                                         com.sun.star.lang.XMultiServiceFactory serviceFactory)
                                  throws java.lang.Exception
Throws:
java.lang.Exception