public static void rethrowIfCorbaSystemException(Throwable e) { RuntimeException re; if (e instanceof java.rmi.MarshalException) re = new org.omg.CORBA.MARSHAL(e.toString()); else if (e instanceof java.rmi.NoSuchObjectException) re = new org.omg.CORBA.OBJECT_NOT_EXIST(e.toString()); else if (e instanceof java.rmi.AccessException) re = new org.omg.CORBA.NO_PERMISSION(e.toString()); else if (e instanceof javax.transaction.TransactionRequiredException) re = new org.omg.CORBA.TRANSACTION_REQUIRED(e.toString()); else if (e instanceof javax.transaction.TransactionRolledbackException) re = new org.omg.CORBA.TRANSACTION_ROLLEDBACK(e.toString()); else if (e instanceof javax.transaction.InvalidTransactionException) re = new org.omg.CORBA.INVALID_TRANSACTION(e.toString()); else if (e instanceof org.omg.CORBA.SystemException) re = (org.omg.CORBA.SystemException) e; else return; re.setStackTrace(e.getStackTrace()); throw re; } }
private void check_state(){ if( state == PREPARED || state == COMMITED ) { throw new org.omg.CORBA.INVALID_TRANSACTION(); } else if( state == ROLLEDBACK ) { throw new org.omg.CORBA.TRANSACTION_ROLLEDBACK(); } }; };
public void register_synchronization(Synchronization sync) throws Inactive, SynchronizationUnavailable{ synchronized(stat_semaphore){ if (status == Status._StatusMarkedRollback){ throw new org.omg.CORBA.TRANSACTION_ROLLEDBACK(); } if (status != Status._StatusActive){ throw new Inactive(); } syncs.addElement(sync); } }
public RecoveryCoordinator register_resource(Resource r) throws Inactive{ synchronized(stat_semaphore){ if (status == Status._StatusMarkedRollback){ throw new org.omg.CORBA.TRANSACTION_ROLLEDBACK(); } if (status != Status._StatusActive){ throw new Inactive(); } resources.addElement(r); votes.addElement(null); } return null; }
public TRANSACTION_ROLLEDBACK xaNota(CompletionStatus cs, Throwable t) { TRANSACTION_ROLLEDBACK exc = new TRANSACTION_ROLLEDBACK(XA_NOTA, cs); if (t != null) exc.initCause(t); if (logger.isLoggable(Level.WARNING)) { Object[] parameters = null; doLog(Level.WARNING, "OMG.xaNota", parameters, OMGSystemException.class, exc); } return exc; }
public TRANSACTION_ROLLEDBACK xaRb( CompletionStatus cs, Throwable t ) { TRANSACTION_ROLLEDBACK exc = new TRANSACTION_ROLLEDBACK( XA_RB, cs ) ; if (t != null) exc.initCause( t ) ; if (logger.isLoggable( Level.WARNING )) { Object[] parameters = null ; doLog( Level.WARNING, "OMG.xaRb", parameters, OMGSystemException.class, exc ) ; } return exc ; }
public TRANSACTION_ROLLEDBACK xaNota( CompletionStatus cs, Throwable t ) { TRANSACTION_ROLLEDBACK exc = new TRANSACTION_ROLLEDBACK( XA_NOTA, cs ) ; if (t != null) exc.initCause( t ) ; if (logger.isLoggable( Level.WARNING )) { Object[] parameters = null ; doLog( Level.WARNING, "OMG.xaNota", parameters, OMGSystemException.class, exc ) ; } return exc ; }
public TRANSACTION_ROLLEDBACK xaEndTrueRollbackDeferred( CompletionStatus cs, Throwable t ) { TRANSACTION_ROLLEDBACK exc = new TRANSACTION_ROLLEDBACK( XA_END_TRUE_ROLLBACK_DEFERRED, cs ) ; if (t != null) exc.initCause( t ) ; if (logger.isLoggable( Level.WARNING )) { Object[] parameters = null ; doLog( Level.WARNING, "OMG.xaEndTrueRollbackDeferred", parameters, OMGSystemException.class, exc ) ; } return exc ; }
public TRANSACTION_ROLLEDBACK xaEndTrueRollbackDeferred(CompletionStatus cs, Throwable t) { TRANSACTION_ROLLEDBACK exc = new TRANSACTION_ROLLEDBACK(XA_END_TRUE_ROLLBACK_DEFERRED, cs); if (t != null) exc.initCause(t); if (logger.isLoggable(Level.WARNING)) { Object[] parameters = null; doLog(Level.WARNING, "OMG.xaEndTrueRollbackDeferred", parameters, OMGSystemException.class, exc); } return exc; }
public TRANSACTION_ROLLEDBACK xaRb(CompletionStatus cs, Throwable t) { TRANSACTION_ROLLEDBACK exc = new TRANSACTION_ROLLEDBACK(XA_RB, cs); if (t != null) exc.initCause(t); if (logger.isLoggable(Level.WARNING)) { Object[] parameters = null; doLog(Level.WARNING, "OMG.xaRb", parameters, OMGSystemException.class, exc); } return exc; }
public TRANSACTION_ROLLEDBACK xaEndTrueRollbackDeferred(CompletionStatus cs, Throwable t) { TRANSACTION_ROLLEDBACK exc = new TRANSACTION_ROLLEDBACK(XA_END_TRUE_ROLLBACK_DEFERRED, cs); if (t != null) exc.initCause(t); if (logger.isLoggable(Level.WARNING)) { Object[] parameters = null; doLog(Level.WARNING, "OMG.xaEndTrueRollbackDeferred", parameters, OMGSystemException.class, exc); } return exc; }
private void check_status( TransactionCoordinator tc ){ Status status = tc.get_state(); if( status.equals( Status.StatusActive ) ){ return; } else if( status.equals( Status.StatusPrepared ) || status.equals( Status.StatusCommitted ) || status.equals( Status.StatusUnknown ) || status.equals( Status.StatusNoTransaction ) || status.equals( Status.StatusPreparing ) || status.equals( Status.StatusCommitting ) ) { throw new org.omg.CORBA.INVALID_TRANSACTION(); } else if (status.equals( Status.StatusRollingBack ) || status.equals( Status.StatusMarkedRollback) || status.equals( Status.StatusRolledBack) ) { throw new org.omg.CORBA.TRANSACTION_ROLLEDBACK(); } } private synchronized boolean attempt_lock_from_queue(){
public TRANSACTION_ROLLEDBACK xaNota(CompletionStatus cs, Throwable t) { TRANSACTION_ROLLEDBACK exc = new TRANSACTION_ROLLEDBACK(XA_NOTA, cs); if (t != null) exc.initCause(t); if (logger.isLoggable(Level.WARNING)) { Object[] parameters = null; doLog(Level.WARNING, "OMG.xaNota", parameters, OMGSystemException.class, exc); } return exc; }
public TRANSACTION_ROLLEDBACK xaRb(CompletionStatus cs, Throwable t) { TRANSACTION_ROLLEDBACK exc = new TRANSACTION_ROLLEDBACK(XA_RB, cs); if (t != null) exc.initCause(t); if (logger.isLoggable(Level.WARNING)) { Object[] parameters = null; doLog(Level.WARNING, "OMG.xaRb", parameters, OMGSystemException.class, exc); } return exc; }
synchronized public Terminator get_localTerminator() throws Unavailable, SystemException { Terminator result = (Terminator) term; // If the transaction has been completed, then raise an exception. // Raise either TRANSACTION_ROLLEDBACK or INVALID_TRANSACTION depending on // whether the transaction has aborted. if( tranState == Status.StatusCommitted ) { INVALID_TRANSACTION exc = new INVALID_TRANSACTION(MinorCode.Completed, CompletionStatus.COMPLETED_NO); throw exc; } if( tranState == Status.StatusRolledBack ) { TRANSACTION_ROLLEDBACK exc = new TRANSACTION_ROLLEDBACK(0,CompletionStatus.COMPLETED_NO); throw exc; } // If there is no reference available, throw the Unavailable exception. if (result == null) { Unavailable exc = new Unavailable(); throw exc; } return result; }
public static void rethrowIfCorbaSystemException(Throwable e) { RuntimeException re; if (e instanceof java.rmi.MarshalException) re = new org.omg.CORBA.MARSHAL(e.toString()); else if (e instanceof java.rmi.NoSuchObjectException) re = new org.omg.CORBA.OBJECT_NOT_EXIST(e.toString()); else if (e instanceof java.rmi.AccessException) re = new org.omg.CORBA.NO_PERMISSION(e.toString()); else if (e instanceof javax.transaction.TransactionRequiredException) re = new org.omg.CORBA.TRANSACTION_REQUIRED(e.toString()); else if (e instanceof javax.transaction.TransactionRolledbackException) re = new org.omg.CORBA.TRANSACTION_ROLLEDBACK(e.toString()); else if (e instanceof javax.transaction.InvalidTransactionException) re = new org.omg.CORBA.INVALID_TRANSACTION(e.toString()); else if (e instanceof org.omg.CORBA.SystemException) re = (org.omg.CORBA.SystemException) e; else return; re.setStackTrace(e.getStackTrace()); throw re; } }
public static void rethrowIfCorbaSystemException(Throwable e) { RuntimeException re; if (e instanceof java.rmi.MarshalException) re = new org.omg.CORBA.MARSHAL(e.toString()); else if (e instanceof java.rmi.NoSuchObjectException) re = new org.omg.CORBA.OBJECT_NOT_EXIST(e.toString()); else if (e instanceof java.rmi.AccessException) re = new org.omg.CORBA.NO_PERMISSION(e.toString()); else if (e instanceof javax.transaction.TransactionRequiredException) re = new org.omg.CORBA.TRANSACTION_REQUIRED(e.toString()); else if (e instanceof javax.transaction.TransactionRolledbackException) re = new org.omg.CORBA.TRANSACTION_ROLLEDBACK(e.toString()); else if (e instanceof javax.transaction.InvalidTransactionException) re = new org.omg.CORBA.INVALID_TRANSACTION(e.toString()); else if (e instanceof org.omg.CORBA.SystemException) re = (org.omg.CORBA.SystemException) e; else return; re.setStackTrace(e.getStackTrace()); throw re; } }
public static org.omg.CORBA.TRANSACTION_ROLLEDBACK read (final org.omg.CORBA.portable.InputStream in) { String id = in.read_string(); if (!id.equals(id())) throw new org.omg.CORBA.MARSHAL("wrong id: " + id); int x0; x0=in.read_ulong(); org.omg.CORBA.CompletionStatus x1; x1=org.omg.CORBA.CompletionStatusHelper.read(in); final org.omg.CORBA.TRANSACTION_ROLLEDBACK result = new org.omg.CORBA.TRANSACTION_ROLLEDBACK(id, x0, x1); return result; } public static void write (final org.omg.CORBA.portable.OutputStream out, final org.omg.CORBA.TRANSACTION_ROLLEDBACK s)
public static org.omg.CORBA.TRANSACTION_ROLLEDBACK read (final org.omg.CORBA.portable.InputStream in) { String id = in.read_string(); if (!id.equals(id())) throw new org.omg.CORBA.MARSHAL("wrong id: " + id); int x0; x0=in.read_ulong(); org.omg.CORBA.CompletionStatus x1; x1=org.omg.CORBA.CompletionStatusHelper.read(in); final org.omg.CORBA.TRANSACTION_ROLLEDBACK result = new org.omg.CORBA.TRANSACTION_ROLLEDBACK(id, x0, x1); return result; } public static void write (final org.omg.CORBA.portable.OutputStream out, final org.omg.CORBA.TRANSACTION_ROLLEDBACK s)
public static TRANSACTION_ROLLEDBACK read( org.omg.CORBA.portable.InputStream in) { if (!id().equals(in.read_string())) throw new MARSHAL(); TRANSACTION_ROLLEDBACK val = new TRANSACTION_ROLLEDBACK(); val.minor = in.read_ulong(); val.completed = CompletionStatus.from_int(in.read_ulong()); return val; }