public MBeanServerConnection getServer() { try { connect(); } catch (Exception e) { throw new org.jboss.util.NestedRuntimeException(e); } return server; } };
/** * Prints the composite message and the embedded stack trace to * <tt>System.err</tt>. */ public void printStackTrace() { printStackTrace(System.err); } }
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; }
public static HandleDelegate getDelegate() { try { final InitialContext ctx = new InitialContext(); return (HandleDelegate) ctx.lookup("java:comp/HandleDelegate"); } catch (NamingException e) { throw new NestedRuntimeException(e); } } }
/** * 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); } }
/** * Constructs a new BasicMBeanRegistry.<p> * @param server * @param defaultDomain * @param clr */ 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); } }
protected Document getAsDocument(String text) { try { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); StringReader sr = new StringReader(text); InputSource is = new InputSource(sr); Document d = db.parse(is); return d; } catch (ParserConfigurationException e) { throw new NestedRuntimeException(e); } catch (SAXException e) { throw new NestedRuntimeException(e); } catch (IOException e) { throw new NestedRuntimeException(e); } } }
public void addChild(QName name, Object value) { String lname = name.getLocalPart(); if( lname.equals("code") ) { ClassLoader loader = Thread.currentThread().getContextClassLoader(); String cname = (String) value; try { clazz = loader.loadClass(cname); } catch(Throwable e) { throw new NestedRuntimeException("Unable to load code: "+cname, e); } } }
public static Admin getAdmin(Properties props) { String adminClassName = getAdminClassName(props); Admin admin = null; if (adminClassName == null) { throw new NestedRuntimeException("Property " + PROP_NAME + " has not been found in input props"); } try { Class adminClass = Class.forName(adminClassName); admin = (Admin) adminClass.newInstance(); } catch (ClassNotFoundException e) { throw new NestedRuntimeException("Class " + adminClassName + " not found.", e); } catch (Exception e) { throw new NestedRuntimeException(e); } return admin; } }
public void addChild(QName name, Object value) { String lname = name.getLocalPart(); if( lname.equals("code") ) { ClassLoader loader = Thread.currentThread().getContextClassLoader(); String cname = (String) value; try { clazz = loader.loadClass(cname); } catch(Throwable e) { throw new NestedRuntimeException("Unable to load code: "+cname, 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); } }
/** * 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); } }
/** * 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); } } }