Package org.objectweb.jotm

Examples of org.objectweb.jotm.Current


        this.namingManager = NamingManager.getInstance();

        this.initialContext = new InitialContext();
        this.logger.debug("InitialContext = ''{0}''.", this.initialContext);
        // fake bind
        this.initialContext.bind("javax.transaction.UserTransaction", new Current());

        Context context = this.namingManager.createEnvironmentContext("test");
        this.namingManager.setComponentContext(context);
    }
View Full Code Here


   /**
    * {@inheritDoc}
    */
   public TransactionManager findTransactionManager() throws Exception
   {
      Current current = Current.getCurrent();
      if (current == null)
      {
         try
         {
            current = SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<Current>()
            {
               public Current run() throws Exception
               {
                  TransactionFactory tm = new TransactionFactoryImpl();
                  return new Current(tm);
               }
            });
         }
         catch (PrivilegedActionException pae)
         {
            Throwable cause = pae.getCause();
            if (cause instanceof RemoteException)
            {
               throw (RemoteException)cause;
            }
            else if (cause instanceof RuntimeException)
            {
               throw (RuntimeException)cause;
            }
            else
            {
               throw new RuntimeException(cause);
            }
         }

         // Change the timeout only if JOTM is not initialized yet
         if (defaultTimeout > 0)
         {
            current.setDefaultTimeout(defaultTimeout);
         }
      }
      else
      {
         LOG.info("Use externally initialized JOTM: " + current);
View Full Code Here

   /**
    * {@inheritDoc}
    */
   public TransactionManager findTransactionManager() throws Exception
   {
      Current current = Current.getCurrent();
      if (current == null)
      {
         try
         {
            current = SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<Current>()
            {
               public Current run() throws Exception
               {
                  TransactionFactory tm = new TransactionFactoryImpl();
                  return new Current(tm);
               }
            });
         }
         catch (PrivilegedActionException pae)
         {
            Throwable cause = pae.getCause();
            if (cause instanceof RemoteException)
            {
               throw (RemoteException)cause;
            }
            else if (cause instanceof RuntimeException)
            {
               throw (RuntimeException)cause;
            }
            else
            {
               throw new RuntimeException(cause);
            }
         }

         // Change the timeout only if JOTM is not initialized yet
         if (defaultTimeout > 0)
         {
            current.setDefaultTimeout(defaultTimeout);
         }
      }
      else
      {
         log.info("Use externally initialized JOTM: " + current);
View Full Code Here

   {
      current = Current.getCurrent();
      if (current == null)
      {
         TransactionFactory tm = new TransactionFactoryImpl();
         current = new Current(tm);

         // Change the timeout only if JOTM is not initialized yet
         if (params != null)
         {
            if (params.getValueParam("timeout") != null)
View Full Code Here

   {
      current = Current.getCurrent();
      if (current == null)
      {
         TransactionFactory tm = new TransactionFactoryImpl();
         current = new Current(tm);

         // Change the timeout only if JOTM is not initialized yet
         if (params != null && params.getValueParam("timeout") != null)
         {
            int t = Integer.parseInt(params.getValueParam("timeout").getValue());
View Full Code Here

   {
      current = Current.getCurrent();
      if (current == null)
      {
         TransactionFactory tm = new TransactionFactoryImpl();
         current = new Current(tm);

         // Change the timeout only if JOTM is not initialized yet
         if (params != null)
         {
            if (params.getValueParam("timeout") != null)
View Full Code Here

    * @param jpaProperties
    * @return
    */   
    private static DataSource createDataSource(Properties jpaProperties) {
        BasicManagedDataSource ds = new BasicManagedDataSource();
        Current tm = new Current();
        ds.setAccessToUnderlyingConnectionAllowed(true);
        ds.setConnectionInitSqls(Collections.EMPTY_LIST);
        ds.setDefaultAutoCommit(true);
//        ds.setDefaultCatalog("mw_as"); // not needed when using the url...
        ds.setDefaultReadOnly(false);
View Full Code Here

            SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<Void>()
            {
               public Void run() throws Exception
               {
                  TransactionFactory tm = new TransactionFactoryImpl();
                  current = new Current(tm);
                  return null;
               }
            });
         }
         catch (PrivilegedActionException pae)
View Full Code Here

TOP

Related Classes of org.objectweb.jotm.Current

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.