Package bitronix.tm.internal

Examples of bitronix.tm.internal.BitronixRuntimeException


        }
    }

    public void waitFor(Object future, long timeout) {
        if (!isUsable())
            throw new BitronixRuntimeException("concurrent executor is disabled because there is no valid executor implementation");
        try {
            futureGetMethod.invoke(future, new Object[] { new Long(timeout), timeUnitMilliseconds});
        } catch (IllegalAccessException ex) {
            throw new BitronixRuntimeException("error calling Future.get()", ex);
        } catch (InvocationTargetException ex) {
            if (ex.getCause().getClass().getName().endsWith("TimeoutException"))
                return; // wait timed out, simply return
            throw new BitronixRuntimeException("error calling Future.get()", ex);
        }
    }
View Full Code Here


        }
    }

    public boolean isDone(Object future) {
        if (!isUsable())
            throw new BitronixRuntimeException("concurrent executor is disabled because there is no valid executor implementation");
        try {
            Boolean b = (Boolean) futureIsDoneMethod.invoke(future, (Object[]) null);
            return b.booleanValue();
        } catch (IllegalAccessException ex) {
            throw new BitronixRuntimeException("error calling Future.isDone()", ex);
        } catch (InvocationTargetException ex) {
            throw new BitronixRuntimeException("error calling Future.isDone()", ex);
        }
    }
View Full Code Here

        return usable;
    }

    public synchronized void shutdown() {
        if (!isUsable())
            throw new BitronixRuntimeException("concurrent executor is disabled because there is no valid executor implementation");
        try {
            executorServiceShutdownMethod.invoke(executorService, (Object[]) null);
        } catch (IllegalAccessException ex) {
            throw new BitronixRuntimeException("error calling ExecutorService.shutdown()", ex);
        } catch (InvocationTargetException ex) {
            throw new BitronixRuntimeException("error calling ExecutorService.shutdown()", ex);
        }
    }
View Full Code Here

    public void waitFor(Object future, long timeout) {
        Thread t = (Thread) future;
        try {
            t.join(timeout);
        } catch (InterruptedException ex) {
            throw new BitronixRuntimeException("job interrupted", ex);
        }
    }
View Full Code Here

                break;
            sb.append((char) b);
        }

        if (sb.length() < LONG_SIZE_IN_BYTES +1)
            throw new BitronixRuntimeException("invalid crypted password '" + data + "'");

        return sb.substring(LONG_SIZE_IN_BYTES);
    }
View Full Code Here

    private static Object buildObjectName(String name) {
        try {
            return objectNameConstructor.newInstance(new Object[] {name});
        } catch (Exception ex) {
            throw new BitronixRuntimeException("cannot build ObjectName with name=" + name, ex);
        }
    }
View Full Code Here

    private static void mbeanServerCall(Method method, Object[] params) {
        try {
            method.invoke(mbeanServer, params);
        } catch (Exception ex) {
            throw new BitronixRuntimeException("cannot call method '" + method.getName() + "'", ex);
        }
    }
View Full Code Here

     */
    public void init() {
        try {
            ResourceRegistrar.register(this);
        } catch (RecoveryException ex) {
            throw new BitronixRuntimeException("error recovering " + this, ex);
        }
    }
View Full Code Here

                    }
                }
                Class<?> proxyFactoryClass = ClassLoaderUtils.loadClass(jdbcProxyFactoryClass);
                return (JdbcProxyFactory) proxyFactoryClass.newInstance();
            } catch (Exception ex) {
                throw new BitronixRuntimeException("error initializing JdbcProxyFactory", ex);
            }
        }
View Full Code Here

                // check for timeout
                long now = MonotonicClock.currentTimeMillis();
                remainingTimeMs -= (now - before);
                before = now;
                if (remainingTimeMs <= 0) {
                    throw new BitronixRuntimeException("cannot get valid connection from " + this + " after trying for " + bean.getAcquisitionTimeout() + "s", ex);
                }
            }
        } // while true
    }
View Full Code Here

TOP

Related Classes of bitronix.tm.internal.BitronixRuntimeException

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.