juh

16:38:17.977 INFO  jd.cli.Main - Decompiling juh.jar
package com.sun.star.comp.helper;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;

final class Bootstrap$1
  extends Thread
{
  Bootstrap$1(String paramString1, InputStream paramInputStream, PrintStream paramPrintStream, String paramString2)
  {
    super(paramString1);
  }
  
  public void run()
  {
    BufferedReader localBufferedReader = new BufferedReader(new InputStreamReader(val$in));
    try
    {
      for (;;)
      {
        String str = localBufferedReader.readLine();
        if (str == null) {
          break;
        }
        val$out.println(val$prefix + str);
      }
    }
    catch (IOException localIOException)
    {
      localIOException.printStackTrace(System.err);
    }
  }
}

/* Location:
 * Qualified Name:     com.sun.star.comp.helper.Bootstrap.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.comp.helper;

import com.sun.star.bridge.UnoUrlResolver;
import com.sun.star.bridge.XUnoUrlResolver;
import com.sun.star.comp.loader.JavaLoader;
import com.sun.star.connection.NoConnectException;
import com.sun.star.container.XSet;
import com.sun.star.lang.XInitialization;
import com.sun.star.lang.XMultiComponentFactory;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.lang.XSingleComponentFactory;
import com.sun.star.lib.util.NativeLibraryLoader;
import com.sun.star.loader.XImplementationLoader;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XComponentContext;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Random;

public class Bootstrap
{
  private static void insertBasicFactories(XSet paramXSet, XImplementationLoader paramXImplementationLoader)
    throws Exception
  {
    paramXSet.insert(paramXImplementationLoader.activate("com.sun.star.comp.loader.JavaLoader", null, null, null));
    
    paramXSet.insert(paramXImplementationLoader.activate("com.sun.star.comp.urlresolver.UrlResolver", null, null, null));
    
    paramXSet.insert(paramXImplementationLoader.activate("com.sun.star.comp.bridgefactory.BridgeFactory", null, null, null));
    
    paramXSet.insert(paramXImplementationLoader.activate("com.sun.star.comp.connections.Connector", null, null, null));
    
    paramXSet.insert(paramXImplementationLoader.activate("com.sun.star.comp.connections.Acceptor", null, null, null));
  }
  
  public static XComponentContext createInitialComponentContext(Hashtable paramHashtable)
    throws Exception
  {
    XImplementationLoader localXImplementationLoader = (XImplementationLoader)UnoRuntime.queryInterface(XImplementationLoader.class, new JavaLoader());
    
    XSingleComponentFactory localXSingleComponentFactory = (XSingleComponentFactory)UnoRuntime.queryInterface(XSingleComponentFactory.class, localXImplementationLoader.activate("com.sun.star.comp.servicemanager.ServiceManager", null, null, null));
    
    XMultiComponentFactory localXMultiComponentFactory = (XMultiComponentFactory)UnoRuntime.queryInterface(XMultiComponentFactory.class, localXSingleComponentFactory.createInstanceWithContext(null));
    
    XInitialization localXInitialization = (XInitialization)UnoRuntime.queryInterface(XInitialization.class, localXImplementationLoader);
    
    Object[] arrayOfObject = { localXMultiComponentFactory };
    localXInitialization.initialize(arrayOfObject);
    if (paramHashtable == null) {
      paramHashtable = new Hashtable(1);
    }
    paramHashtable.put("/singletons/com.sun.star.lang.theServiceManager", new ComponentContextEntry(null, localXMultiComponentFactory));
    
    ComponentContext localComponentContext = new ComponentContext(paramHashtable, null);
    
    localXInitialization = (XInitialization)UnoRuntime.queryInterface(XInitialization.class, localXMultiComponentFactory);
    
    arrayOfObject = new Object[] { null, localComponentContext };
    localXInitialization.initialize(arrayOfObject);
    
    XSet localXSet = (XSet)UnoRuntime.queryInterface(XSet.class, localXMultiComponentFactory);
    
    localXSet.insert(localXSingleComponentFactory);
    
    insertBasicFactories(localXSet, localXImplementationLoader);
    
    return localComponentContext;
  }
  
  public static XMultiServiceFactory createSimpleServiceManager()
    throws Exception
  {
    return (XMultiServiceFactory)UnoRuntime.queryInterface(XMultiServiceFactory.class, createInitialComponentContext(null).getServiceManager());
  }
  
  public static final XComponentContext defaultBootstrap_InitialComponentContext()
    throws Exception
  {
    return defaultBootstrap_InitialComponentContext(null, null);
  }
  
  public static final XComponentContext defaultBootstrap_InitialComponentContext(String paramString, Hashtable paramHashtable)
    throws Exception
  {
    String[] arrayOfString = null;
    if (null != paramHashtable)
    {
      arrayOfString = new String[2 * paramHashtable.size()];
      Enumeration localEnumeration = paramHashtable.keys();
      int i = 0;
      while (localEnumeration.hasMoreElements())
      {
        String str = (String)localEnumeration.nextElement();
        arrayOfString[(i++)] = str;
        arrayOfString[(i++)] = ((String)paramHashtable.get(str));
      }
    }
    if (!m_loaded_juh)
    {
      NativeLibraryLoader.loadLibrary(Bootstrap.class.getClassLoader(), "juh");
      m_loaded_juh = true;
    }
    return (XComponentContext)UnoRuntime.queryInterface(XComponentContext.class, cppuhelper_bootstrap(paramString, arrayOfString, Bootstrap.class.getClassLoader()));
  }
  
  private static boolean m_loaded_juh = false;
  
  private static native Object cppuhelper_bootstrap(String paramString, String[] paramArrayOfString, ClassLoader paramClassLoader)
    throws Exception;
  
  public static final XComponentContext bootstrap()
    throws BootstrapException
  {
    XComponentContext localXComponentContext1 = null;
    try
    {
      XComponentContext localXComponentContext2 = createInitialComponentContext(null);
      if (localXComponentContext2 == null) {
        throw new BootstrapException("no local component context!");
      }
      String str1 = System.getProperty("os.name").startsWith("Windows") ? "soffice.exe" : "soffice";
      
      File localFile = NativeLibraryLoader.getResource(Bootstrap.class.getClassLoader(), str1);
      if (localFile == null) {
        throw new BootstrapException("no office executable found!");
      }
      String str2 = "uno" + Long.toString(new Random().nextLong() & 0x7FFFFFFFFFFFFFFF);
      
      String[] arrayOfString = new String[7];
      arrayOfString[0] = localFile.getPath();
      arrayOfString[1] = "-nologo";
      arrayOfString[2] = "-nodefault";
      arrayOfString[3] = "-norestore";
      arrayOfString[4] = "-nocrashreport";
      arrayOfString[5] = "-nolockcheck";
      arrayOfString[6] = ("-accept=pipe,name=" + str2 + ";urp;");
      
      Process localProcess = Runtime.getRuntime().exec(arrayOfString);
      pipe(localProcess.getInputStream(), System.out, "CO> ");
      pipe(localProcess.getErrorStream(), System.err, "CE> ");
      
      XMultiComponentFactory localXMultiComponentFactory = localXComponentContext2.getServiceManager();
      if (localXMultiComponentFactory == null) {
        throw new BootstrapException("no initial service manager!");
      }
      XUnoUrlResolver localXUnoUrlResolver = UnoUrlResolver.create(localXComponentContext2);
      
      String str3 = "uno:pipe,name=" + str2 + ";urp;StarOffice.ComponentContext";
      for (int i = 0;; i++) {
        try
        {
          Object localObject = localXUnoUrlResolver.resolve(str3);
          localXComponentContext1 = (XComponentContext)UnoRuntime.queryInterface(XComponentContext.class, localObject);
          if (localXComponentContext1 == null) {
            throw new BootstrapException("no component context!");
          }
        }
        catch (NoConnectException localNoConnectException)
        {
          if (i == 600) {
            throw new BootstrapException(localNoConnectException.toString());
          }
          Thread.currentThread();Thread.sleep(500L);
        }
      }
    }
    catch (BootstrapException localBootstrapException)
    {
      throw localBootstrapException;
    }
    catch (RuntimeException localRuntimeException)
    {
      throw localRuntimeException;
    }
    catch (Exception localException)
    {
      throw new BootstrapException(localException);
    }
    return localXComponentContext1;
  }
  
  private static void pipe(final InputStream paramInputStream, final PrintStream paramPrintStream, final String paramString)
  {
    new Thread("Pipe: " + paramString)
    {
      public void run()
      {
        BufferedReader localBufferedReader = new BufferedReader(new InputStreamReader(paramInputStream));
        try
        {
          for (;;)
          {
            String str = localBufferedReader.readLine();
            if (str == null) {
              break;
            }
            paramPrintStream.println(paramString + str);
          }
        }
        catch (IOException localIOException)
        {
          localIOException.printStackTrace(System.err);
        }
      }
    }.start();
  }
}

/* Location:
 * Qualified Name:     com.sun.star.comp.helper.Bootstrap
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.comp.helper;

public class BootstrapException
  extends Exception
{
  private Exception m_target = null;
  
  public BootstrapException() {}
  
  public BootstrapException(String paramString)
  {
    super(paramString);
  }
  
  public BootstrapException(String paramString, Exception paramException)
  {
    super(paramString);
    m_target = paramException;
  }
  
  public BootstrapException(Exception paramException)
  {
    m_target = paramException;
  }
  
  public Exception getTargetException()
  {
    return m_target;
  }
}

/* Location:
 * Qualified Name:     com.sun.star.comp.helper.BootstrapException
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.comp.helper;

import com.sun.star.lang.EventObject;
import com.sun.star.lang.XComponent;
import com.sun.star.lang.XEventListener;
import com.sun.star.lang.XMultiComponentFactory;
import com.sun.star.lang.XSingleComponentFactory;
import com.sun.star.uno.Any;
import com.sun.star.uno.Exception;
import com.sun.star.uno.RuntimeException;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XComponentContext;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Vector;

public class ComponentContext
  implements XComponentContext, XComponent
{
  private static final boolean DEBUG = false;
  private static final String SMGR_NAME = "/singletons/com.sun.star.lang.theServiceManager";
  private static final String TDMGR_NAME = "/singletons/com.sun.star.reflection.theTypeDescriptionManager";
  private Hashtable m_table;
  private XComponentContext m_xDelegate;
  private XMultiComponentFactory m_xSMgr;
  private boolean m_bDisposeSMgr;
  private Vector m_eventListener;
  
  public ComponentContext(Hashtable paramHashtable, XComponentContext paramXComponentContext)
  {
    m_eventListener = new Vector();
    m_table = paramHashtable;
    m_xDelegate = paramXComponentContext;
    m_xSMgr = null;
    m_bDisposeSMgr = false;
    
    Object localObject = paramHashtable.get("/singletons/com.sun.star.lang.theServiceManager");
    if (localObject != null)
    {
      if ((localObject instanceof ComponentContextEntry)) {
        localObject = m_value;
      }
      m_xSMgr = ((XMultiComponentFactory)UnoRuntime.queryInterface(XMultiComponentFactory.class, localObject));
    }
    if (m_xSMgr != null) {
      m_bDisposeSMgr = true;
    } else if (m_xDelegate != null) {
      m_xSMgr = m_xDelegate.getServiceManager();
    }
    XComponent localXComponent = (XComponent)UnoRuntime.queryInterface(XComponent.class, m_xDelegate);
    if (localXComponent != null) {
      localXComponent.addEventListener(new Disposer(this));
    }
  }
  
  public Object getValueByName(String paramString)
  {
    Object localObject1 = m_table.get(paramString);
    if (localObject1 != null)
    {
      if ((localObject1 instanceof ComponentContextEntry))
      {
        ComponentContextEntry localComponentContextEntry = (ComponentContextEntry)localObject1;
        if (m_lateInit != null)
        {
          Object localObject2 = null;
          Object localObject3;
          try
          {
            String str = (String)m_lateInit;
            if (str != null)
            {
              if (m_xSMgr != null) {
                localObject2 = m_xSMgr.createInstanceWithContext(str, this);
              }
            }
            else
            {
              localObject3 = (XSingleComponentFactory)UnoRuntime.queryInterface(XSingleComponentFactory.class, m_lateInit);
              if (localObject3 != null) {
                localObject2 = ((XSingleComponentFactory)localObject3).createInstanceWithContext(this);
              }
            }
          }
          catch (Exception localException) {}
          if (localObject2 != null) {
            synchronized (localComponentContextEntry)
            {
              if (m_lateInit != null)
              {
                m_value = localObject2;
                m_lateInit = null;
              }
              else
              {
                localObject3 = (XComponent)UnoRuntime.queryInterface(XComponent.class, localObject2);
                if (localObject3 != null) {
                  ((XComponent)localObject3).dispose();
                }
              }
            }
          }
        }
        return m_value;
      }
      return localObject1;
    }
    if (m_xDelegate != null) {
      return m_xDelegate.getValueByName(paramString);
    }
    return Any.VOID;
  }
  
  public XMultiComponentFactory getServiceManager()
  {
    return m_xSMgr;
  }
  
  public void dispose()
  {
    EventObject localEventObject = new EventObject(this);
    Enumeration localEnumeration1 = m_eventListener.elements();
    while (localEnumeration1.hasMoreElements())
    {
      localObject1 = (XEventListener)localEnumeration1.nextElement();
      ((XEventListener)localObject1).disposing(localEventObject);
    }
    m_eventListener.removeAllElements();
    
    Object localObject1 = null;
    
    Enumeration localEnumeration2 = m_table.keys();
    Object localObject2;
    while (localEnumeration2.hasMoreElements())
    {
      localObject2 = (String)localEnumeration2.nextElement();
      if (!((String)localObject2).equals("/singletons/com.sun.star.lang.theServiceManager"))
      {
        Object localObject3 = m_table.get(localObject2);
        if ((localObject3 instanceof ComponentContextEntry)) {
          localObject3 = m_value;
        }
        XComponent localXComponent = (XComponent)UnoRuntime.queryInterface(XComponent.class, localObject3);
        if (localXComponent != null) {
          if (((String)localObject2).equals("/singletons/com.sun.star.reflection.theTypeDescriptionManager")) {
            localObject1 = localXComponent;
          } else {
            localXComponent.dispose();
          }
        }
      }
    }
    m_table.clear();
    if (m_bDisposeSMgr)
    {
      localObject2 = (XComponent)UnoRuntime.queryInterface(XComponent.class, m_xSMgr);
      if (localObject2 != null) {
        ((XComponent)localObject2).dispose();
      }
    }
    m_xSMgr = null;
    if (localObject1 != null) {
      ((XComponent)localObject1).dispose();
    }
  }
  
  public void addEventListener(XEventListener paramXEventListener)
  {
    if (paramXEventListener == null) {
      throw new RuntimeException("Listener must not be null");
    }
    if (m_eventListener.contains(paramXEventListener)) {
      throw new RuntimeException("Listener already registred.");
    }
    m_eventListener.addElement(paramXEventListener);
  }
  
  public void removeEventListener(XEventListener paramXEventListener)
  {
    if (paramXEventListener == null) {
      throw new RuntimeException("Listener must not be null");
    }
    if (!m_eventListener.contains(paramXEventListener)) {
      throw new RuntimeException("Listener is not registered.");
    }
    m_eventListener.removeElement(paramXEventListener);
  }
}

/* Location:
 * Qualified Name:     com.sun.star.comp.helper.ComponentContext
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.comp.helper;

public class ComponentContextEntry
{
  public Object m_lateInit;
  public Object m_value;
  
  public ComponentContextEntry(Object paramObject1, Object paramObject2)
  {
    m_lateInit = paramObject1;
    m_value = paramObject2;
  }
  
  public ComponentContextEntry(Object paramObject)
  {
    m_lateInit = null;
    m_value = paramObject;
  }
}

/* Location:
 * Qualified Name:     com.sun.star.comp.helper.ComponentContextEntry
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.comp.helper;

import com.sun.star.lang.EventObject;
import com.sun.star.lang.XComponent;
import com.sun.star.lang.XEventListener;

class Disposer
  implements XEventListener
{
  private XComponent m_xComp;
  
  Disposer(XComponent paramXComponent)
  {
    m_xComp = paramXComponent;
  }
  
  public void disposing(EventObject paramEventObject)
  {
    m_xComp.dispose();
  }
}

/* Location:
 * Qualified Name:     com.sun.star.comp.helper.Disposer
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.comp.helper;

import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.Exception;
import com.sun.star.uno.RuntimeException;
import com.sun.star.uno.UnoRuntime;

/**
 * @deprecated
 */
public class RegistryServiceFactory
{
  static
  {
    System.loadLibrary("juh");
  }
  
  public static XMultiServiceFactory create(String paramString1, String paramString2)
    throws Exception
  {
    return create(paramString1, paramString2, false);
  }
  
  public static XMultiServiceFactory create(String paramString1, String paramString2, boolean paramBoolean)
    throws Exception
  {
    String str = System.getProperty("java.vm.info");
    if ((str != null) && (str.indexOf("green") != -1)) {
      throw new RuntimeException(RegistryServiceFactory.class.toString() + ".create - can't use binary UNO with green threads");
    }
    if ((paramString1 == null) && (paramString2 == null)) {
      throw new Exception("No registry is specified!");
    }
    Object localObject = createRegistryServiceFactory(paramString1, paramString2, paramBoolean, RegistryServiceFactory.class.getClassLoader());
    
    return (XMultiServiceFactory)UnoRuntime.queryInterface(XMultiServiceFactory.class, localObject);
  }
  
  public static XMultiServiceFactory create(String paramString)
    throws Exception
  {
    return create(paramString, null, false);
  }
  
  public static XMultiServiceFactory create(String paramString, boolean paramBoolean)
    throws Exception
  {
    return create(paramString, null, paramBoolean);
  }
  
  public static XMultiServiceFactory create()
    throws Exception
  {
    return create(null, null, false);
  }
  
  private static native Object createRegistryServiceFactory(String paramString1, String paramString2, boolean paramBoolean, ClassLoader paramClassLoader);
}

/* Location:
 * Qualified Name:     com.sun.star.comp.helper.RegistryServiceFactory
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.comp.helper;

import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.lang.XSingleServiceFactory;
import com.sun.star.registry.InvalidRegistryException;
import com.sun.star.registry.XRegistryKey;
import com.sun.star.uno.RuntimeException;
import com.sun.star.uno.UnoRuntime;

/**
 * @deprecated
 */
public class SharedLibraryLoader
{
  public static final String DEFAULT_LIBRARY = "shlibloader.uno";
  public static final String DEFAULT_IMPLEMENTATION = "com.sun.star.comp.stoc.DLLComponentLoader";
  
  static
  {
    System.loadLibrary("juh");
  }
  
  public static XSingleServiceFactory getServiceFactory(XMultiServiceFactory paramXMultiServiceFactory, XRegistryKey paramXRegistryKey)
  {
    return (XSingleServiceFactory)UnoRuntime.queryInterface(XSingleServiceFactory.class, component_getFactory("shlibloader.uno", "com.sun.star.comp.stoc.DLLComponentLoader", paramXMultiServiceFactory, paramXRegistryKey, SharedLibraryLoader.class.getClassLoader()));
  }
  
  public static XSingleServiceFactory getServiceFactory(String paramString1, String paramString2, XMultiServiceFactory paramXMultiServiceFactory, XRegistryKey paramXRegistryKey)
  {
    return (XSingleServiceFactory)UnoRuntime.queryInterface(XSingleServiceFactory.class, component_getFactory(paramString1, paramString2, paramXMultiServiceFactory, paramXRegistryKey, SharedLibraryLoader.class.getClassLoader()));
  }
  
  public static boolean writeRegistryServiceInfo(XMultiServiceFactory paramXMultiServiceFactory, XRegistryKey paramXRegistryKey)
  {
    return component_writeInfo("shlibloader.uno", paramXMultiServiceFactory, paramXRegistryKey, SharedLibraryLoader.class.getClassLoader());
  }
  
  public static boolean writeRegistryServiceInfo(String paramString, XMultiServiceFactory paramXMultiServiceFactory, XRegistryKey paramXRegistryKey)
    throws InvalidRegistryException, RuntimeException
  {
    return component_writeInfo(paramString, paramXMultiServiceFactory, paramXRegistryKey, SharedLibraryLoader.class.getClassLoader());
  }
  
  private static native boolean component_writeInfo(String paramString, XMultiServiceFactory paramXMultiServiceFactory, XRegistryKey paramXRegistryKey, ClassLoader paramClassLoader);
  
  private static native Object component_getFactory(String paramString1, String paramString2, XMultiServiceFactory paramXMultiServiceFactory, XRegistryKey paramXRegistryKey, ClassLoader paramClassLoader);
}

/* Location:
 * Qualified Name:     com.sun.star.comp.helper.SharedLibraryLoader
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.comp.helper;

import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;

public final class UnoInfo
{
  private static String getBase()
  {
    String str1 = null;
    
    URLClassLoader localURLClassLoader = (URLClassLoader)UnoInfo.class.getClassLoader();
    URL[] arrayOfURL = localURLClassLoader.getURLs();
    for (int i = 0; i < arrayOfURL.length; i++)
    {
      String str2 = arrayOfURL[i].toString();
      if (str2.endsWith("/juh.jar"))
      {
        int j = str2.lastIndexOf("/juh.jar");
        if (j >= 0)
        {
          str1 = str2.substring(0, j + 1);
          break;
        }
      }
    }
    return str1;
  }
  
  private static URL[] getURLs(String[] paramArrayOfString)
  {
    URL[] arrayOfURL = new URL[paramArrayOfString.length];
    String str = getBase();
    for (int i = 0; i < paramArrayOfString.length; i++) {
      try
      {
        arrayOfURL[i] = new URL(str + paramArrayOfString[i]);
      }
      catch (MalformedURLException localMalformedURLException)
      {
        return null;
      }
    }
    return arrayOfURL;
  }
  
  public static URL[] getJars()
  {
    String[] arrayOfString = { "jurt.jar", "ridl.jar", "juh.jar", "unoil.jar" };
    
    return getURLs(arrayOfString);
  }
  
  public static URL[] getExtraTypes()
  {
    return new URL[0];
  }
}

/* Location:
 * Qualified Name:     com.sun.star.comp.helper.UnoInfo
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.comp;

import com.sun.star.comp.juhtest.SmoketestCommandEnvironment;
import com.sun.star.lang.XSingleComponentFactory;
import com.sun.star.lib.uno.helper.Factory;

public class JavaUNOHelperServices
{
  private static final String __service_smoketestCommandEnv = "com.sun.star.deployment.test.SmoketestCommandEnvironment";
  
  public static XSingleComponentFactory __getComponentFactory(String paramString)
  {
    XSingleComponentFactory localXSingleComponentFactory = null;
    if (paramString.equals(SmoketestCommandEnvironment.class.getName())) {
      localXSingleComponentFactory = Factory.createComponentFactory(SmoketestCommandEnvironment.class, SmoketestCommandEnvironment.getServiceNames());
    }
    return localXSingleComponentFactory;
  }
}

/* Location:
 * Qualified Name:     com.sun.star.comp.JavaUNOHelperServices
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.comp.juhtest;

import com.sun.star.task.XInteractionAbort;
import com.sun.star.task.XInteractionApprove;
import com.sun.star.task.XInteractionContinuation;
import com.sun.star.task.XInteractionHandler;
import com.sun.star.task.XInteractionRequest;
import com.sun.star.uno.UnoRuntime;

class InteractionImpl
  implements XInteractionHandler
{
  public void handle(XInteractionRequest paramXInteractionRequest)
  {
    Object localObject1 = paramXInteractionRequest.getRequest();
    
    int i = 1;
    int j = 0;
    
    XInteractionContinuation[] arrayOfXInteractionContinuation = paramXInteractionRequest.getContinuations();
    for (int k = 0; k < arrayOfXInteractionContinuation.length; k++)
    {
      Object localObject2;
      if (i != 0)
      {
        localObject2 = (XInteractionApprove)UnoRuntime.queryInterface(XInteractionApprove.class, arrayOfXInteractionContinuation[k]);
        if (localObject2 != null) {
          ((XInteractionApprove)localObject2).select();
        }
        i = 0;
      }
      else if (j != 0)
      {
        localObject2 = (XInteractionAbort)UnoRuntime.queryInterface(XInteractionAbort.class, arrayOfXInteractionContinuation[k]);
        if (localObject2 != null) {
          ((XInteractionAbort)localObject2).select();
        }
        j = 0;
      }
    }
  }
}

/* Location:
 * Qualified Name:     com.sun.star.comp.juhtest.InteractionImpl
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.comp.juhtest;

import com.sun.star.ucb.XProgressHandler;

class ProgressImpl
  implements XProgressHandler
{
  public void push(Object paramObject) {}
  
  public void update(Object paramObject) {}
  
  public void pop() {}
}

/* Location:
 * Qualified Name:     com.sun.star.comp.juhtest.ProgressImpl
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.comp.juhtest;

import com.sun.star.lang.XMultiComponentFactory;
import com.sun.star.lang.XServiceInfo;
import com.sun.star.lib.uno.helper.WeakBase;
import com.sun.star.task.XInteractionHandler;
import com.sun.star.ucb.XCommandEnvironment;
import com.sun.star.ucb.XProgressHandler;
import com.sun.star.uno.XComponentContext;

public class SmoketestCommandEnvironment
  extends WeakBase
  implements XServiceInfo, XCommandEnvironment
{
  private static final String __serviceName = "com.sun.star.deployment.test.SmoketestCommandEnvironment";
  private XComponentContext m_cmpCtx;
  private XMultiComponentFactory m_xMCF;
  
  public SmoketestCommandEnvironment(XComponentContext paramXComponentContext)
  {
    try
    {
      m_cmpCtx = paramXComponentContext;
      m_xMCF = m_cmpCtx.getServiceManager();
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
  }
  
  public static String[] getServiceNames()
  {
    String[] arrayOfString = { "com.sun.star.deployment.test.SmoketestCommandEnvironment" };
    return arrayOfString;
  }
  
  public String[] getSupportedServiceNames()
  {
    return getServiceNames();
  }
  
  public boolean supportsService(String paramString)
  {
    boolean bool = false;
    if (paramString.equals("com.sun.star.deployment.test.SmoketestCommandEnvironment")) {
      bool = true;
    }
    return bool;
  }
  
  public String getImplementationName()
  {
    return SmoketestCommandEnvironment.class.getName();
  }
  
  public XInteractionHandler getInteractionHandler()
  {
    return new InteractionImpl();
  }
  
  public XProgressHandler getProgressHandler()
  {
    return new ProgressImpl();
  }
}

/* Location:
 * Qualified Name:     com.sun.star.comp.juhtest.SmoketestCommandEnvironment
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.lib.uno.adapter;

import com.sun.star.io.BufferSizeExceededException;
import com.sun.star.io.IOException;
import com.sun.star.io.NotConnectedException;
import com.sun.star.io.XInputStream;
import com.sun.star.io.XSeekable;
import com.sun.star.lang.IllegalArgumentException;
import com.sun.star.lib.uno.helper.ComponentBase;

public class ByteArrayToXInputStreamAdapter
  extends ComponentBase
  implements XInputStream, XSeekable
{
  byte[] m_bytes;
  int m_length;
  int m_pos;
  boolean m_open;
  
  public ByteArrayToXInputStreamAdapter(byte[] paramArrayOfByte)
  {
    init(paramArrayOfByte);
  }
  
  public void init(byte[] paramArrayOfByte)
  {
    m_bytes = paramArrayOfByte;
    m_length = paramArrayOfByte.length;
    m_pos = 0;
    m_open = true;
  }
  
  private void _check()
    throws NotConnectedException, IOException
  {
    if (m_bytes == null) {
      throw new NotConnectedException("no bytes");
    }
    if (!m_open) {
      throw new IOException("input closed");
    }
  }
  
  public int available()
    throws NotConnectedException, IOException
  {
    _check();
    long l = m_length - m_pos;
    if (l != (int)l) {
      throw new IOException("integer overflow");
    }
    return (int)l;
  }
  
  public void closeInput()
    throws NotConnectedException, IOException
  {
    _check();
    m_open = false;
  }
  
  public int readBytes(byte[][] paramArrayOfByte, int paramInt)
    throws NotConnectedException, BufferSizeExceededException, IOException
  {
    _check();
    try
    {
      int i = m_length - m_pos;
      if (paramInt > i) {
        paramInt = i;
      }
      if (paramArrayOfByte[0] == null) {
        paramArrayOfByte[0] = new byte[paramInt];
      }
      System.arraycopy(m_bytes, m_pos, paramArrayOfByte[0], 0, paramInt);
      
      m_pos += paramInt;
      return paramInt;
    }
    catch (ArrayIndexOutOfBoundsException localArrayIndexOutOfBoundsException)
    {
      localArrayIndexOutOfBoundsException.printStackTrace();
      throw new BufferSizeExceededException("buffer overflow");
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
      throw new IOException("error accessing buffer");
    }
  }
  
  public int readSomeBytes(byte[][] paramArrayOfByte, int paramInt)
    throws NotConnectedException, BufferSizeExceededException, IOException
  {
    return readBytes(paramArrayOfByte, paramInt);
  }
  
  public void skipBytes(int paramInt)
    throws NotConnectedException, BufferSizeExceededException, IOException
  {
    _check();
    if (paramInt > m_length - m_pos) {
      throw new BufferSizeExceededException("buffer overflow");
    }
    m_pos += paramInt;
  }
  
  public long getLength()
    throws IOException
  {
    if (m_bytes != null) {
      return m_length;
    }
    throw new IOException("no bytes");
  }
  
  public long getPosition()
    throws IOException
  {
    if (m_bytes != null) {
      return m_pos;
    }
    throw new IOException("no bytes");
  }
  
  public void seek(long paramLong)
    throws IllegalArgumentException, IOException
  {
    if (m_bytes != null)
    {
      if ((paramLong < 0L) || (paramLong > m_length)) {
        throw new IllegalArgumentException("invalid seek position");
      }
      m_pos = ((int)paramLong);
    }
    else
    {
      throw new IOException("no bytes");
    }
  }
  
  public void finalize()
    throws Throwable
  {
    super.finalize();
  }
}

/* Location:
 * Qualified Name:     com.sun.star.lib.uno.adapter.ByteArrayToXInputStreamAdapter
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.lib.uno.adapter;

import com.sun.star.io.XInputStream;
import java.io.InputStream;

public class InputStreamToXInputStreamAdapter
  implements XInputStream
{
  private InputStream iIn;
  
  public InputStreamToXInputStreamAdapter(InputStream paramInputStream)
  {
    iIn = paramInputStream;
  }
  
  public int available()
    throws com.sun.star.io.IOException
  {
    int i;
    try
    {
      i = iIn.available();
    }
    catch (java.io.IOException localIOException)
    {
      throw new com.sun.star.io.IOException(localIOException.toString());
    }
    return i;
  }
  
  public void closeInput()
    throws com.sun.star.io.IOException
  {
    try
    {
      iIn.close();
    }
    catch (java.io.IOException localIOException)
    {
      throw new com.sun.star.io.IOException(localIOException.toString());
    }
  }
  
  public int readBytes(byte[][] paramArrayOfByte, int paramInt)
    throws com.sun.star.io.IOException
  {
    int i = 0;
    try
    {
      long l = 0L;
      if (paramInt > iIn.available()) {
        l = iIn.read(paramArrayOfByte[0], 0, iIn.available());
      } else {
        l = iIn.read(paramArrayOfByte[0], 0, paramInt);
      }
      if (l <= 0L) {
        return 0;
      }
      return (int)l;
    }
    catch (java.io.IOException localIOException)
    {
      throw new com.sun.star.io.IOException("reader error: " + localIOException.toString());
    }
  }
  
  public int readSomeBytes(byte[][] paramArrayOfByte, int paramInt)
    throws com.sun.star.io.IOException
  {
    int i = 0;
    try
    {
      long l = 0L;
      if (paramInt > iIn.available()) {
        l = iIn.read(paramArrayOfByte[0], 0, iIn.available());
      } else {
        l = iIn.read(paramArrayOfByte[0], 0, paramInt);
      }
      if (l <= 0L) {
        return 0;
      }
      return (int)l;
    }
    catch (java.io.IOException localIOException)
    {
      throw new com.sun.star.io.IOException("reader error: " + localIOException.toString());
    }
  }
  
  public void skipBytes(int paramInt)
    throws com.sun.star.io.IOException
  {
    int j = paramInt;
    try
    {
      int i = iIn.available();
    }
    catch (java.io.IOException localIOException1)
    {
      throw new com.sun.star.io.IOException(localIOException1.toString());
    }
    do
    {
      int k;
      if (j >= Integer.MAX_VALUE) {
        k = Integer.MAX_VALUE;
      } else {
        k = j;
      }
      j -= k;
      try
      {
        iIn.skip(k);
      }
      catch (java.io.IOException localIOException2)
      {
        throw new com.sun.star.io.IOException(localIOException2.toString());
      }
    } while (j > 0);
  }
}

/* Location:
 * Qualified Name:     com.sun.star.lib.uno.adapter.InputStreamToXInputStreamAdapter
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.lib.uno.adapter;

import com.sun.star.io.XOutputStream;
import java.io.OutputStream;

public class OutputStreamToXOutputStreamAdapter
  implements XOutputStream
{
  OutputStream iOut;
  
  public OutputStreamToXOutputStreamAdapter(OutputStream paramOutputStream)
  {
    iOut = paramOutputStream;
  }
  
  public void closeOutput()
    throws com.sun.star.io.IOException
  {
    try
    {
      iOut.close();
    }
    catch (java.io.IOException localIOException)
    {
      throw new com.sun.star.io.IOException(localIOException.toString());
    }
  }
  
  public void flush()
    throws com.sun.star.io.IOException
  {
    try
    {
      iOut.flush();
    }
    catch (java.io.IOException localIOException)
    {
      throw new com.sun.star.io.IOException(localIOException.toString());
    }
  }
  
  public void writeBytes(byte[] paramArrayOfByte)
    throws com.sun.star.io.IOException
  {
    try
    {
      iOut.write(paramArrayOfByte);
    }
    catch (java.io.IOException localIOException)
    {
      throw new com.sun.star.io.IOException(localIOException.toString());
    }
  }
}

/* Location:
 * Qualified Name:     com.sun.star.lib.uno.adapter.OutputStreamToXOutputStreamAdapter
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.lib.uno.adapter;

import com.sun.star.io.XInputStream;
import java.io.IOException;
import java.io.InputStream;

public class XInputStreamToInputStreamAdapter
  extends InputStream
{
  private XInputStream xin;
  
  public XInputStreamToInputStreamAdapter(XInputStream paramXInputStream)
  {
    xin = paramXInputStream;
  }
  
  public int available()
    throws IOException
  {
    int i;
    try
    {
      i = xin.available();
    }
    catch (Exception localException)
    {
      throw new IOException(localException.toString());
    }
    return i;
  }
  
  public void close()
    throws IOException
  {
    try
    {
      xin.closeInput();
    }
    catch (Exception localException)
    {
      throw new IOException(localException.toString());
    }
  }
  
  public int read()
    throws IOException
  {
    byte[][] arrayOfByte = new byte[1][1];
    try
    {
      long l = xin.readBytes(arrayOfByte, 1);
      if (l <= 0L) {
        return -1;
      }
      int i = arrayOfByte[0][0];
      if (i < 0) {}
      return 256 + i;
    }
    catch (Exception localException)
    {
      throw new IOException(localException.toString());
    }
  }
  
  public int read(byte[] paramArrayOfByte)
    throws IOException
  {
    byte[][] arrayOfByte = new byte[1][paramArrayOfByte.length];
    int i;
    try
    {
      i = xin.readBytes(arrayOfByte, paramArrayOfByte.length);
      if (i <= 0) {
        return -1;
      }
      if (i < paramArrayOfByte.length) {
        System.arraycopy(arrayOfByte[0], 0, paramArrayOfByte, 0, i);
      } else {
        System.arraycopy(arrayOfByte[0], 0, paramArrayOfByte, 0, paramArrayOfByte.length);
      }
    }
    catch (Exception localException)
    {
      throw new IOException(localException.toString());
    }
    return i;
  }
  
  public int read(byte[] paramArrayOfByte, int paramInt1, int paramInt2)
    throws IOException
  {
    int i = 0;
    byte[][] arrayOfByte = new byte[1][paramArrayOfByte.length];
    try
    {
      long l = 0L;
      int j = xin.available();
      if ((j != 0) && (paramInt2 > j)) {
        l = xin.readBytes(arrayOfByte, j);
      } else {
        l = xin.readBytes(arrayOfByte, paramInt2);
      }
      if (l <= 0L) {
        return -1;
      }
      if (l < paramInt2) {
        System.arraycopy(arrayOfByte[0], 0, paramArrayOfByte, paramInt1, (int)l);
      } else {
        System.arraycopy(arrayOfByte[0], 0, paramArrayOfByte, paramInt1, paramInt2);
      }
      return (int)l;
    }
    catch (Exception localException)
    {
      throw new IOException("reader error: " + localException.toString());
    }
  }
  
  public long skip(long paramLong)
    throws IOException
  {
    long l = paramLong;
    int i;
    try
    {
      i = xin.available();
    }
    catch (Exception localException1)
    {
      throw new IOException(localException1.toString());
    }
    do
    {
      int j;
      if (l >= 2147483647L) {
        j = Integer.MAX_VALUE;
      } else {
        j = (int)l;
      }
      l -= j;
      try
      {
        xin.skipBytes(j);
      }
      catch (Exception localException2)
      {
        throw new IOException(localException2.toString());
      }
    } while (l > 0L);
    if ((i != 0) && (i < paramLong)) {
      return i;
    }
    return paramLong;
  }
  
  public boolean markSupported()
  {
    return false;
  }
  
  public void mark(int paramInt) {}
  
  public void reset()
    throws IOException
  {}
}

/* Location:
 * Qualified Name:     com.sun.star.lib.uno.adapter.XInputStreamToInputStreamAdapter
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.lib.uno.adapter;

import com.sun.star.io.BufferSizeExceededException;
import com.sun.star.io.IOException;
import com.sun.star.io.NotConnectedException;
import com.su
1 2 3 4

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd