/** * Rethrow a throwable as a deployment exception if it isn't already. * * @param message the message * @param t the throwable * @throws DeploymentException always */ public static DeploymentException rethrowAsDeploymentException(String message, Throwable t) throws DeploymentException { if (t instanceof DeploymentException) throw (DeploymentException) t; else throw new DeploymentException(message, t); }
protected void startService() throws Exception { if (MBeanProxyExt.remote != null) throw new IllegalStateException("Remote MBeanServerConnection is already set " + MBeanProxyExt.remote); Object o = server.getAttribute(mbeanServerConnection, "Proxy"); if (o instanceof MBeanServerConnection == false) throw new DeploymentException(mbeanServerConnection + " does not define an MBeanServerConnection"); MBeanProxyExt.remote = (MBeanServerConnection) o; }
private Object newInstance(String className) throws DeploymentException { Class clazz = loadClass(className); try { return clazz.newInstance(); } catch(Exception e) { throw new DeploymentException("Failed to instantiate " + className, e); } } private Class loadClass(String className) throws DeploymentException
public void init(JDBCStoreManager manager) throws DeploymentException { if (CONNECTION_PREPARE == null) { throw new DeploymentException("Create command requires JDBC 3.0 (JDK1.4+)"); } super.init(manager); }
protected JDBCCMPFieldBridge getGeneratedPKField() throws DeploymentException { // extract the pk field to be generated JDBCCMPFieldBridge pkField = null; JDBCFieldBridge[] pkFields = entity.getPrimaryKeyFields(); for(int i = 0; i < pkFields.length; ++i) { if(pkField != null) throw new DeploymentException("Generation only supported with single PK field"); pkField = (JDBCCMPFieldBridge)pkFields[i]; } return pkField; }
private Class loadClass(String className) throws DeploymentException { try { final ClassLoader contextClassLoader = TCLAction.UTIL.getContextClassLoader(); return contextClassLoader.loadClass(className); } catch(ClassNotFoundException e) { throw new DeploymentException("Failed to load class: " + className, e); } } }
public void importXml(Element rootElement) throws DeploymentException { String rootTag = rootElement.getOwnerDocument().getDocumentElement().getTagName(); if (rootTag.equals("application")) importXml(rootElement, false); else if (rootTag.equals("jboss-app")) importXml(rootElement, true); else throw new DeploymentException("Unrecognized root tag: " + rootTag); }
protected void initEntityCommand(JDBCEntityCommandMetaData entityCommand) throws DeploymentException { super.initEntityCommand(entityCommand); sequence = entityCommand.getAttribute("sequence"); if (sequence == null) { throw new DeploymentException("Sequence must be specified"); } }
protected void initEntityCommand(JDBCEntityCommandMetaData entityCommand) throws DeploymentException { super.initEntityCommand(entityCommand); sequence_name = entityCommand.getAttribute("sequence_name"); if (sequence_name == null) { throw new DeploymentException("sequence_name attribute must be specified inside <entity-command>"); } }
protected void initEntityCommand(JDBCEntityCommandMetaData entityCommand) throws DeploymentException { String objectName = entityCommand.getAttribute("SQLExceptionProcessor"); if(objectName != null) { try { exceptionProcessor = (SQLExceptionProcessorMBean) MBeanProxyExt.create(SQLExceptionProcessorMBean.class, objectName); } catch(MalformedObjectNameException e) { throw new DeploymentException("Invalid object name for SQLExceptionProcessor: ", e); } } }
protected void initEntityCommand(JDBCEntityCommandMetaData entityCommand) throws DeploymentException { super.initEntityCommand(entityCommand); pkSQL = entityCommand.getAttribute("pk-sql"); if(pkSQL == null) { throw new DeploymentException("pk-sql attribute must be set for entity " + entity.getEntityName()); } if(debug) { log.debug("Generate PK sql is: " + pkSQL); } }
public void init(JDBCStoreManager2 manager) throws DeploymentException { this.entityBridge = (JDBCEntityBridge2)manager.getEntityBridge(); this.log = Logger.getLogger(getClass().getName() + "." + entityBridge.getEntityName()); final JDBCFieldBridge[] pkFields = entityBridge.getPrimaryKeyFields(); if(pkFields.length > 1) { throw new DeploymentException("This entity-command cannot be used with composite primary keys!"); } this.pkField = (JDBCCMPFieldBridge2) pkFields[0]; this.pkSql = ""; }
private Method[] getQueryMethods(QueryMetaData queryData) throws DeploymentException { String methodName = queryData.getMethodName(); try { Class[] parameters = Classes.convertToJavaClasses(queryData.getMethodParams(), entity.getClassLoader()); return getQueryMethods(methodName, parameters); } catch(ClassNotFoundException cnfe) { throw new DeploymentException(cnfe.getMessage()); } }
public void deploy(DeploymentInfo unit) throws DeploymentException { if (!ignoreDeployment(unit) && isWebServiceDeployment(unit)) { super.deploy(unit); // Calls create log.debug("deploy: " + unit.shortName); Deployment dep = getDeployment(unit); if (dep == null || (dep.getState() != Deployment.DeploymentState.CREATED) ) throw new DeploymentException("Create step failed"); getRuntime().start(dep); unit.context.put(Deployment.class, dep); } } }
public void deploy(DeploymentInfo unit) throws DeploymentException { if (!ignoreDeployment(unit) && isWebServiceDeployment(unit)) { super.deploy(unit); // Calls create log.debug("deploy: " + unit.shortName); Deployment dep = getDeployment(unit); if (dep == null || (dep.getState() != Deployment.DeploymentState.CREATED) ) throw new DeploymentException("Create step failed"); getRuntime().start(dep); unit.context.put(Deployment.class, dep); } } }
public void deploy(DeploymentInfo unit) throws DeploymentException { if (ignoreDeployment(unit)) return; if (!ignoreDeployment(unit) && isWebServiceDeployment(unit)) { log.debug("deploy: " + unit.shortName); Deployment dep = getDeployment(unit); if(null==dep || Deployment.DeploymentState.CREATED != dep.getState()) throw new DeploymentException("Create step is missing"); getRuntime().start(dep); } }
public void deploy(DeploymentInfo unit) throws DeploymentException { if (ignoreDeployment(unit)) return; if (!ignoreDeployment(unit) && isWebServiceDeployment(unit)) { log.debug("deploy: " + unit.shortName); Deployment dep = getDeployment(unit); if(null==dep || Deployment.DeploymentState.CREATED != dep.getState()) throw new DeploymentException("Create step is missing"); getRuntime().start(dep); } }
public void deploy(DeploymentInfo unit) throws DeploymentException { if (ignoreDeployment(unit)) return; if (!ignoreDeployment(unit) && isWebServiceDeployment(unit)) { log.debug("deploy: " + unit.shortName); Deployment dep = getDeployment(unit); if (null == dep || Deployment.DeploymentState.CREATED != dep.getState()) throw new DeploymentException("Create step failed"); getRuntime().start(dep); } }
public void deploy(DeploymentInfo unit) throws DeploymentException { if (ignoreDeployment(unit)) return; if (!ignoreDeployment(unit) && isWebServiceDeployment(unit)) { log.debug("deploy: " + unit.shortName); Deployment dep = getDeployment(unit); if (null == dep || Deployment.DeploymentState.CREATED != dep.getState()) throw new DeploymentException("Create step failed"); getRuntime().start(dep); } }
public void create() throws Exception { super.create (); // Get a reference to the DS service ClusterConfigMetaData config = getContainer().getBeanMetaData().getClusterConfigMetaData(); String partitionName = config.getPartitionName(); String name = "jboss:service=DistributedState,partitionName=" + partitionName; ds = (DistributedState) Registry.lookup (name); if( ds == null ) throw new DeploymentException("Failed to find DistributedState service: "+name); }