public static File createTempDirectory() throws IOException { File tmpdir = null; try { // TODO: recursive dependency, ohoh ServerConfig config = SPIProvider.getInstance().getSPI(ServerConfigFactory.class).getServerConfig(); tmpdir = new File(config.getServerTempDir().getCanonicalPath() + "/jbossws"); if (!tmpdir.mkdirs()) { tmpdir = null; } } catch (Throwable t) { // Use the Java temp directory if there is no server config (the client) tmpdir = null; } return tmpdir; } }
/** Get the temp file for a given namespace */ public static File getSchemaTempFile(String targetNS) throws IOException { if (targetNS.length() == 0) throw MESSAGES.illegalNullArgument("target namespace"); String fname = targetNS; if (fname.indexOf("://") > 0) fname = fname.substring(fname.indexOf("://") + 3); File tmpdir = null; try { SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider(); ServerConfig serverConfig = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig(); tmpdir = serverConfig.getServerTempDir(); tmpdir = new File(tmpdir.getCanonicalPath() + "/jbossws"); tmpdir.mkdirs(); } catch (Throwable th) { // ignore if the server config cannot be found // this would be the case if we are on the client side } fname = fname.replace('/', '_'); fname = fname.replace(':', '_'); fname = fname.replace('?', '_'); fname = fname.replace('#', '_'); return File.createTempFile("JBossWS_" + fname, ".xsd", tmpdir); }
File tmpdir = new File(config.getServerTempDir().getCanonicalPath() + "/deploy");
File tmpDir = new File(serverConfig.getServerTempDir().getCanonicalPath() + "/jbossws"); tmpDir.mkdirs();
File tmpDir = new File(serverConfig.getServerTempDir().getCanonicalPath() + "/jbossws"); tmpDir.mkdirs();
File tmpDir = new File(serverConfig.getServerTempDir().getCanonicalPath() + "/jbossws"); tmpDir.mkdirs();
@Override public void start(final StartContext ctx) throws StartException { ROOT_LOGGER.starting(name); String serverTempDir = serverConfigInjectorValue.getValue().getServerTempDir().getAbsolutePath(); ClassLoader cl = ClassLoaderProvider.getDefaultProvider().getServerJAXRPCIntegrationClassLoader(); pclwa = new WebAppController(hostInjector.getValue().getHost(), "org.jboss.ws.core.server.PortComponentLinkServlet", cl, "/jbossws", "/pclink", serverTempDir); }
ServerConfig sc = getServerConfig(); if (sc != null) { os.setOutputDir(sc.getServerTempDir());
private static WebDeploymentController startWebApp(WebHost host, DeploymentUnit unit) throws Exception { WebDeploymentBuilder deployment = new WebDeploymentBuilder(); WebDeploymentController handle; try { JBossWebMetaData jbwebMD = unit.getAttachment(WSAttachmentKeys.JBOSSWEB_METADATA_KEY); deployment.setContextRoot(jbwebMD.getContextRoot()); File docBase = new File(ServerConfigFactoryImpl.getConfig().getServerTempDir(), jbwebMD.getContextRoot()); if (!docBase.exists()) { docBase.mkdirs(); } deployment.setDocumentRoot(docBase); deployment.setClassLoader(unit.getAttachment(WSAttachmentKeys.CLASSLOADER_KEY)); deployment.addAllowedRequestPredicate(new AllowWSRequestPredicate()); addServlets(jbwebMD, deployment); handle = host.addWebDeployment(deployment); handle.create(); } catch (Exception e) { throw WSLogger.ROOT_LOGGER.createContextPhaseFailed(e); } try { handle.start(); } catch (Exception e) { throw WSLogger.ROOT_LOGGER.startContextPhaseFailed(e); } return handle; }
private static WebDeploymentController startWebApp(WebHost host, DeploymentUnit unit) throws Exception { WebDeploymentBuilder deployment = new WebDeploymentBuilder(); WebDeploymentController handle; try { JBossWebMetaData jbwebMD = unit.getAttachment(WSAttachmentKeys.JBOSSWEB_METADATA_KEY); deployment.setContextRoot(jbwebMD.getContextRoot()); ServerConfigService config = (ServerConfigService)unit.getServiceRegistry().getService(WSServices.CONFIG_SERVICE).getService(); File docBase = new File(config.getValue().getServerTempDir(), jbwebMD.getContextRoot()); if (!docBase.exists()) { docBase.mkdirs(); } deployment.setDocumentRoot(docBase); deployment.setClassLoader(unit.getAttachment(WSAttachmentKeys.CLASSLOADER_KEY)); deployment.addAllowedRequestPredicate(new AllowWSRequestPredicate()); addServlets(jbwebMD, deployment); handle = host.addWebDeployment(deployment); handle.create(); } catch (Exception e) { throw WSLogger.ROOT_LOGGER.createContextPhaseFailed(e); } try { handle.start(); } catch (Exception e) { throw WSLogger.ROOT_LOGGER.startContextPhaseFailed(e); } return handle; }
private static StandardContext startWebApp(Host host, WSEndpointDeploymentUnit unit) throws Exception { StandardContext context = new StandardContext(); try { JBossWebMetaData jbwebMD = unit.getAttachment(WSAttachmentKeys.JBOSSWEB_METADATA_KEY); context.setPath(jbwebMD.getContextRoot()); context.addLifecycleListener(new ContextConfig()); ServerConfigService config = (ServerConfigService)unit.getServiceRegistry().getService(WSServices.CONFIG_SERVICE).getService(); File docBase = new File(config.getValue().getServerTempDir(), jbwebMD.getContextRoot()); if (!docBase.exists()) { docBase.mkdirs(); } context.setDocBase(docBase.getPath()); final Loader loader = new WebCtxLoader(unit.getAttachment(WSAttachmentKeys.CLASSLOADER_KEY)); loader.setContainer(host); context.setLoader(loader); context.setInstanceManager(new LocalInstanceManager()); addServlets(jbwebMD, context); host.addChild(context); context.create(); } catch (Exception e) { throw MESSAGES.createContextPhaseFailed(e); } try { context.start(); } catch (LifecycleException e) { throw MESSAGES.startContextPhaseFailed(e); } return context; }