java_uno

16:37:13.804 INFO  jd.cli.Main - Decompiling java_uno.jar
package com.sun.star.bridges.jni_uno;

import com.sun.star.lib.util.NativeLibraryLoader;

public final class JNI_info_holder
{
  static
  {
    NativeLibraryLoader.loadLibrary(JNI_info_holder.class.getClassLoader(), "java_uno");
  }
  
  private static JNI_info_holder s_holder = new JNI_info_holder();
  private static long s_jni_info_handle;
  
  protected void finalize()
  {
    finalize(s_jni_info_handle);
  }
  
  private native void finalize(long paramLong);
}

/* Location:
 * Qualified Name:     com.sun.star.bridges.jni_uno.JNI_info_holder
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.bridges.jni_uno;

import com.sun.star.lib.util.AsynchronousFinalizer.Job;

class JNI_proxy$1
  implements AsynchronousFinalizer.Job
{
  JNI_proxy$1(JNI_proxy paramJNI_proxy) {}
  
  public void run()
    throws Throwable
  {
    JNI_proxy.access$000(this$0, this$0.m_bridge_handle);
  }
}

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

import com.sun.star.lib.util.AsynchronousFinalizer;
import com.sun.star.lib.util.AsynchronousFinalizer.Job;
import com.sun.star.lib.util.NativeLibraryLoader;
import com.sun.star.uno.IEnvironment;
import com.sun.star.uno.IQueryInterface;
import com.sun.star.uno.RuntimeException;
import com.sun.star.uno.Type;
import com.sun.star.uno.UnoRuntime;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public final class JNI_proxy
  implements InvocationHandler
{
  static
  {
    NativeLibraryLoader.loadLibrary(JNI_proxy.class.getClassLoader(), "java_uno");
  }
  
  protected static ClassLoader s_classloader = JNI_proxy.class.getClassLoader();
  protected static Class[] s_InvocationHandler = { InvocationHandler.class };
  protected long m_bridge_handle;
  protected IEnvironment m_java_env;
  protected long m_receiver_handle;
  protected long m_td_handle;
  protected Type m_type;
  protected String m_oid;
  protected Class m_class;
  
  public static String get_stack_trace(Throwable paramThrowable)
    throws Throwable
  {
    int i = 0;
    if (null == paramThrowable)
    {
      paramThrowable = new Throwable();
      i = 1;
    }
    StringWriter localStringWriter = new StringWriter();
    
    PrintWriter localPrintWriter = new PrintWriter(localStringWriter, true);
    
    paramThrowable.printStackTrace(localPrintWriter);
    localPrintWriter.flush();
    localPrintWriter.close();
    localStringWriter.flush();
    String str = localStringWriter.toString();
    if (i != 0)
    {
      int j = str.indexOf('\n');
      j = str.indexOf('\n', j + 1);
      str = str.substring(j + 1);
    }
    return "\njava stack trace:\n" + str;
  }
  
  public void finalize()
  {
    AsynchronousFinalizer.add(new AsynchronousFinalizer.Job()
    {
      public void run()
        throws Throwable
      {
        JNI_proxy.this.finalize(m_bridge_handle);
      }
    });
  }
  
  private JNI_proxy(long paramLong1, IEnvironment paramIEnvironment, long paramLong2, long paramLong3, Type paramType, String paramString)
  {
    m_bridge_handle = paramLong1;
    m_java_env = paramIEnvironment;
    m_receiver_handle = paramLong2;
    m_td_handle = paramLong3;
    m_type = paramType;
    m_oid = paramString;
    m_class = m_type.getZClass();
  }
  
  public static Object create(long paramLong1, IEnvironment paramIEnvironment, long paramLong2, long paramLong3, Type paramType, String paramString, Constructor paramConstructor)
    throws Throwable
  {
    JNI_proxy localJNI_proxy = new JNI_proxy(paramLong1, paramIEnvironment, paramLong2, paramLong3, paramType, paramString);
    
    Object localObject = paramConstructor.newInstance(new Object[] { localJNI_proxy });
    return paramIEnvironment.registerInterface(localObject, new String[] { paramString }, paramType);
  }
  
  public static Constructor get_proxy_ctor(Class paramClass)
    throws Throwable
  {
    Class localClass = java.lang.reflect.Proxy.getProxyClass(s_classloader, new Class[] { paramClass, IQueryInterface.class, com.sun.star.lib.uno.Proxy.class });
    
    return localClass.getConstructor(s_InvocationHandler);
  }
  
  public Object invoke(Object paramObject, Method paramMethod, Object[] paramArrayOfObject)
    throws Throwable
  {
    Class localClass = paramMethod.getDeclaringClass();
    String str = paramMethod.getName();
    if (Object.class.equals(localClass))
    {
      if (str.equals("hashCode")) {
        return new Integer(m_oid.hashCode());
      }
      if (str.equals("equals")) {
        return isSame(paramArrayOfObject[0]);
      }
      if (str.equals("toString")) {
        return toString() + " [oid=" + m_oid + ", type=" + m_type.getTypeName() + "]";
      }
    }
    else
    {
      if (localClass.isAssignableFrom(m_class)) {
        return dispatch_call(m_bridge_handle, localClass.getName(), str, paramArrayOfObject);
      }
      if (IQueryInterface.class.equals(localClass))
      {
        if (str.equals("queryInterface"))
        {
          Object localObject = m_java_env.getRegisteredInterface(m_oid, (Type)paramArrayOfObject[0]);
          if (null == localObject) {
            return dispatch_call(m_bridge_handle, "com.sun.star.uno.XInterface", str, paramArrayOfObject);
          }
          return localObject;
        }
        if (str.equals("isSame")) {
          return isSame(paramArrayOfObject[0]);
        }
        if (str.equals("getOid")) {
          return m_oid;
        }
      }
    }
    throw new RuntimeException("[jni_uno bridge error] unexpected call on proxy " + paramObject.toString() + ": " + paramMethod.toString());
  }
  
  private Boolean isSame(Object paramObject)
  {
    return new Boolean((paramObject != null) && (m_oid.equals(UnoRuntime.generateOid(paramObject))));
  }
  
  private native void finalize(long paramLong);
  
  private native Object dispatch_call(long paramLong, String paramString1, String paramString2, Object[] paramArrayOfObject)
    throws Throwable;
}

/* Location:
 * Qualified Name:     com.sun.star.bridges.jni_uno.JNI_proxy
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
1

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