public void deploy(DeploymentUnit unit) throws DeploymentException { RubyApplicationMetaData rubyAppMetaData = unit.getAttachment(RubyApplicationMetaData.class); if (rubyAppMetaData.getEnvironmentName() == null || rubyAppMetaData.getEnvironmentName().trim().equals("")) { rubyAppMetaData.setEnvironmentName(DEFAULT_ENVIRONMENT_NAME); } }
@Override public void deploy(DeploymentUnit unit) throws DeploymentException { if (unit.getAllMetaData(MessageProcessorMetaData.class).isEmpty()) { return; } PoolMetaData pool = AttachmentUtils.getAttachment(unit, "messaging", PoolMetaData.class); if (pool == null) { RubyApplicationMetaData envMetaData = unit.getAttachment(RubyApplicationMetaData.class); boolean devMode = envMetaData != null && envMetaData.isDevelopmentMode(); pool = devMode ? new PoolMetaData("messaging", 1, 2) : new PoolMetaData("messaging"); pool.setInstanceFactoryName(this.instanceFactoryName); AttachmentUtils.multipleAttach(unit, pool, "messaging"); } }
@SuppressWarnings("unchecked") public void parse(VFSDeploymentUnit unit, Object dataObj) throws Exception { log.debug("Deploying ruby application: " + unit); log.info("UNIT.root: " + unit.getRoot()); log.info("UNIT.root.uri: " + unit.getRoot().toURI()); log.info("UNIT.root.uri.url: " + unit.getRoot().toURI().toURL()); log.info("UNIT.root.uri.url.ext: " + unit.getRoot().toURI().toURL().toExternalForm()); RubyApplicationMetaData appMetaData = unit.getAttachment(RubyApplicationMetaData.class); if (appMetaData == null) { log.debug("Configuring ruby application: " + unit); appMetaData = new RubyApplicationMetaData(); appMetaData.setApplicationName(unit.getSimpleName()); unit.addAttachment(RubyApplicationMetaData.class, appMetaData); } else { log.debug("Configuring pre-existing ruby application: " + unit + "\n " + appMetaData); } Map<String, String> app = (Map<String, String>) dataObj; if (appMetaData.getRoot() == null) { String root = getOneOf(app, "root", "RAILS_ROOT", "RACK_ROOT"); if (root != null && !root.trim().equals("")) { appMetaData.setRoot(root.trim()); } } if (appMetaData.getEnvironmentName() == null) { String env = getOneOf(app, "env", "RAILS_ENV", "RACK_ENV"); if (env != null && !env.trim().equals("")) { appMetaData.setEnvironmentName(env.trim()); } } log.debug("Configured ruby application: " + unit + "\n " + appMetaData); }