public MBeanServerConnection getServer() { try { connect(); } catch (Exception e) { throw new org.jboss.util.NestedRuntimeException(e); } return server; } };
public void closeServer() { if (jmxc != null) { server = null; try { jmxc.close(); } catch (IOException e) { throw new org.jboss.util.NestedRuntimeException(e); } } }
protected static void rethrowAsSystemException(String context, Transaction tx, Throwable t) throws SystemException { if (t instanceof SystemException) throw (SystemException) t; if (t instanceof RuntimeException) throw (RuntimeException) t; if (t instanceof Error) throw (Error) t; if (t instanceof RollbackException) throw new IllegalStateException(context + " tx=" + tx + " marked for rollback."); throw new NestedRuntimeException(context + " tx=" + tx + " got unexpected error ", t); }
public static HandleDelegate getDelegate() { try { InitialContext ctx = new InitialContext(); return (HandleDelegate) ctx.lookup("java:comp/HandleDelegate"); } catch (NamingException e) { throw new NestedRuntimeException(e); } }
public Object instantiate() { Interceptor i; // todo: Check for a ctor() try { i = (Interceptor) clazz.newInstance(); } catch (Throwable e) { throw new NestedRuntimeException("Failed to instantiate interceptor", e); } return i; }
public Object instantiate() { Interceptor i; // todo: Check for a ctor() try { i = (Interceptor) clazz.newInstance(); } catch (Throwable e) { throw new NestedRuntimeException("Failed to instantiate interceptor", e); } return i; }
/** * Constructs a new BasicMBeanRegistry.<p> */ public BasicMBeanRegistry(MBeanServer server, String defaultDomain, ClassLoaderRepository clr) { // Store the context this.server = server; this.defaultDomain = defaultDomain; try { loaderRepository = (LoaderRepository) clr; mbeanInfoService = new ObjectName("user:service=MBeanInfoDB"); } catch (Exception e) { throw new NestedRuntimeException("Error instantiating registry", e); } }
public static HandleDelegate getDelegate() { try { final InitialContext ctx = new InitialContext(); return (HandleDelegate) ctx.lookup("java:comp/HandleDelegate"); } catch (NamingException e) { throw new NestedRuntimeException(e); } } }
private EJBLocalObject createEJBLocalObject(Object id) { InvocationHandler handler = new EntityProxy(localJndiName, id, this); try { return (EJBLocalObject) proxyClassConstructor.newInstance(new Object[]{handler}); } catch(Exception ex) { throw new NestedRuntimeException(ex); } }
public OracleValidConnectionChecker() { try { initPing(); } catch (Exception e) { throw new NestedRuntimeException("Unable to resolve pingDatabase method:", e); } }
public EJBLocalObject getStatefulSessionEJBLocalObject(Object id) { InvocationHandler handler = new StatefulSessionProxy(localJndiName, id, this); try { return (EJBLocalObject) proxyClassConstructor.newInstance(new Object[]{handler}); } catch(Exception ex) { throw new NestedRuntimeException(ex); } }
public static synchronized VersionedConstructorInterceptor getInstance() { try { if (instance == null) { instance = new VersionedConstructorInterceptor(); } return instance; } catch (Exception ex) { throw new NestedRuntimeException(ex); } }
/** * Returns a ObjectName for the input object converted to a string. * * @return a ObjectName object * * @throws org.jboss.util.NestedRuntimeException An MalformedObjectNameException occured. */ public Object getValue() { try { return new ObjectName(getAsText()); } catch (MalformedObjectNameException e) { throw new NestedRuntimeException(e); } } }
/** * Lock for the given transaction * * @param tx the transaction */ static void lock(Transaction tx) { try { txSynchs.lock(tx); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new NestedRuntimeException("Unable to get synchronization", e); } }
public int getTransactionTimeout() throws SystemException { try { return getCM().getTransactionTimeout(); } catch (ResourceException e) { throw new NestedRuntimeException("Unable to retrieve connection manager", e); } }
public void checkTransactionActive() throws RollbackException, SystemException { try { getCM().checkTransactionActive(); } catch (ResourceException e) { throw new NestedRuntimeException("Unable to retrieve connection manager", e); } }
public long getTimeLeftBeforeTransactionTimeout(boolean errorRollback) throws RollbackException { try { return getCM().getTimeLeftBeforeTransactionTimeout(errorRollback); } catch (ResourceException e) { throw new NestedRuntimeException("Unable to retrieve connection manager", e); } }
/** * Returns a URI for the input object converted to a string. * * @return a URI object * * @throws NestedRuntimeException An MalformedURLException occured. */ public Object getValue() { try { return Strings.toURI(getAsText()); } catch (URISyntaxException e) { throw new NestedRuntimeException(e); } } }
public void setUp() { try { super.setUp(); receiverBrowser = receiverSession.createBrowser(receiverQueue); senderBrowser = senderSession.createBrowser(senderQueue); } catch (JMSException e) { throw new NestedRuntimeException(e); } }
public void setUp() { super.setUp(); try { queueConnection = queueConnectionFactory.createQueueConnection(); queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); topicConnection = topicConnectionFactory.createTopicConnection(); topicSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE); queueConnection.start(); topicConnection.start(); } catch (Exception e) { throw new NestedRuntimeException(e); } }