Skip to content
Permalink
Browse files
Merge branch 'better-osgi-2' into 'ibm-trunk'
Better osgi 2

Make yoko actually work under osgi with it's own UtilDelegate impl class and fix unused code and class mispellings.
  • Loading branch information
David Jencks committed Nov 13, 2014
2 parents 1066834 + 83d8610 commit 0cc9a72bd9ab1eee1229a479a865de23ba6d9239
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 43 deletions.
@@ -59,12 +59,12 @@ public class UtilImpl implements UtilDelegate {
// initializer the _secman field will be null
private static final SecMan _secman = getSecMan();

static final Class JAVAX_TRANSACTION_USERTRANSACTION_CLASS;
static Class JAVAX_TRANSACTION_USERTRANSACTION_CLASS;

static {
public UtilImpl() {
Class userTransactionClass;
try {
userTransactionClass = Util.loadClass("javax.transaction.userTransaction", null, null);
userTransactionClass = Util.loadClass("javax.transaction.UserTransaction", null, null);
}
catch (ClassNotFoundException e) {
logger.log(Level.FINE, "error loading transaction class", e);
@@ -882,45 +882,45 @@ public void unexportObject(Remote obj)
tie.deactivate();
}

static final Class[] RMI_TO_CORBA_EXCEPTION;

// We want to avoid a dependency on JTA, so we add these classes only if JTA is available.

static {
Class[] rmiToCorba;
try {
rmiToCorba = new Class[]{
Util.loadClass("javax.transaction.HeuristicMixedException", null, null),
org.omg.CosTransactions.HeuristicMixed.class,

Util.loadClass("javax.transaction.HeuristicRollbackException", null, null),
org.omg.CosTransactions.HeuristicRollback.class,

Util.loadClass("javax.transaction.HeuristicCommitException", null, null),
org.omg.CosTransactions.HeuristicCommit.class,

Util.loadClass("javax.transaction.NotSupportedException", null, null),
org.omg.CosTransactions.SubtransactionsUnavailable.class,

Util.loadClass("javax.transaction.InvalidTransactionException", null, null),
org.omg.CORBA.INVALID_TRANSACTION.class,

Util.loadClass("javax.transaction.TransactionRequiredException", null, null),
org.omg.CORBA.TRANSACTION_REQUIRED.class,

Util.loadClass("javax.transaction.TransactionRolledbackException", null, null),
org.omg.CORBA.TRANSACTION_ROLLEDBACK.class,

Util.loadClass("javax.transaction.RollbackException", null, null),
org.omg.CORBA.TRANSACTION_ROLLEDBACK.class
};

}
catch (ClassNotFoundException e) {
rmiToCorba = new Class[0];
}
RMI_TO_CORBA_EXCEPTION = rmiToCorba;
}
// static final Class[] RMI_TO_CORBA_EXCEPTION;
//
//// We want to avoid a dependency on JTA, so we add these classes only if JTA is available.
//
// static {
// Class[] rmiToCorba;
// try {
// rmiToCorba = new Class[]{
// Util.loadClass("javax.transaction.HeuristicMixedException", null, null),
// org.omg.CosTransactions.HeuristicMixed.class,
//
// Util.loadClass("javax.transaction.HeuristicRollbackException", null, null),
// org.omg.CosTransactions.HeuristicRollback.class,
//
// Util.loadClass("javax.transaction.HeuristicCommitException", null, null),
// org.omg.CosTransactions.HeuristicCommit.class,
//
// Util.loadClass("javax.transaction.NotSupportedException", null, null),
// org.omg.CosTransactions.SubtransactionsUnavailable.class,
//
// Util.loadClass("javax.transaction.InvalidTransactionException", null, null),
// org.omg.CORBA.INVALID_TRANSACTION.class,
//
// Util.loadClass("javax.transaction.TransactionRequiredException", null, null),
// org.omg.CORBA.TRANSACTION_REQUIRED.class,
//
// Util.loadClass("javax.transaction.TransactionRolledbackException", null, null),
// org.omg.CORBA.TRANSACTION_ROLLEDBACK.class,
//
// Util.loadClass("javax.transaction.RollbackException", null, null),
// org.omg.CORBA.TRANSACTION_ROLLEDBACK.class
// };
//
// }
// catch (ClassNotFoundException e) {
// rmiToCorba = new Class[0];
// }
// RMI_TO_CORBA_EXCEPTION = rmiToCorba;
// }

static final Class[] CORBA_TO_RMI_EXCEPTION = {
org.omg.CORBA.BAD_PARAM.class, java.rmi.MarshalException.class,
@@ -12,9 +12,11 @@ public class Activator extends AbstractBundleActivator {
private ProviderRegistryImpl register;

public Activator() {
super(new Info[] {new Info("javax.rmi.CORBA.UtilClass", "org.apache.yoko.rmi.impl.UtilImpl", 1)},
super(new Info[] {},
new Info[] {new Info("javax.rmi.CORBA.PortableRemoteObjectClass", "org.apache.yoko.rmi.impl.PortableRemoteObjectImpl", 1),
new Info("javax.rmi.CORBA.UtilClass", "org.apache.yoko.rmi.impl.UtilImpl", 1),
new Info("org.apache.yoko.rmi.PortableRemoteObjectExtClass", "org.apache.yoko.rmi.impl.PortableRemoteObjectExtImpl", 1),
new Info("org.apache.yoko.rmi.RMIStubInitializerClass", "org.apache.yoko.rmi.impl.RMIStubInitializer", 1),
new Info("javax.rmi.CORBA.StubClass", "org.apache.yoko.rmi.impl.StubImpl", 1)});
}

0 comments on commit 0cc9a72

Please sign in to comment.