com.linar.jintegra
Interface Instanciator

All Known Implementing Classes:
Jvm

public interface Instanciator

This interface controls the instanciation of Java objects on behalf of COM objects.

Pass a reference to an object which implements this interface when registering the JVM using the Jvm class.

The default instanciator implementation used by the Jvm looks like this:

  public Object instanciate(String javaClass) throws AutomationException {
    try {
      return Class.forName(javaClass).newInstance();
    } catch(Exception e) {
      e.printStackTrace();
      throw new AutomationException(e);
    }
  }

It can also be used in COM accessing EJB example.


Method Summary
 java.lang.Object instanciate(java.lang.String javaClass)
          Instanciates a Java object.
 

Method Detail

instanciate

java.lang.Object instanciate(java.lang.String javaClass)
                             throws AutomationException
Instanciates a Java object. Called by the Jintegra runtime when a COM object wishes to create an instance of a new Java object. You are free to do anything you wish in this method, such as return references to existing Java objects.

Parameters:
javaClass - The name of the Java class to be instanciated
Returns:
return value. A reference to the instanciated object
Throws:
AutomationException - If any other exception occurs.