Package javax.enterprise.deploy.shared.factories

Examples of javax.enterprise.deploy.shared.factories.DeploymentFactoryManager


      }
   }
  
   private DeploymentManager createDeploymentManager(Server server) throws DeploymentManagerCreationException
   {
      DeploymentFactoryManager dfm = DeploymentFactoryManager.getInstance();
      return dfm.getDeploymentManager(server.getServerUrl(), null, null);
   }
View Full Code Here


    public static String[] deploy(PortletRequest actionRequest, File moduleFile, File planFile)
            throws PortletException {
        // TODO this is a duplicate of the code from
        // org.apache.geronimo.console.configmanager.DeploymentPortlet.processAction()
        // TODO need to eliminate this duplicate code
        DeploymentFactoryManager dfm = DeploymentFactoryManager.getInstance();
        String[] statusMsgs = new String[2];
        try {
            DeploymentManager mgr = dfm.getDeploymentManager("deployer:geronimo:inVM", null, null);
            try {
                if (mgr instanceof JMXDeploymentManager) {
                    ((JMXDeploymentManager) mgr).setLogConfiguration(false, true);
                }
               
View Full Code Here

        new DeploymentFactoryImpl();

        ClassLoader oldcl = Thread.currentThread().getContextClassLoader();
        try {
            Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
            DeploymentFactoryManager factoryManager = DeploymentFactoryManager.getInstance();
            DeploymentManager manager = factoryManager.getDeploymentManager(getUri(), getUsername(), getPassword());
            return manager;
        } finally {
            Thread.currentThread().setContextClassLoader(oldcl);
        }
    }
View Full Code Here

      return contextInst.get();
   }
  
   private DeploymentManager createDeploymentManager() throws DeploymentManagerCreationException
   {
      DeploymentFactoryManager dfm = DeploymentFactoryManager.getInstance();
      return dfm.getDeploymentManager(configuration.getProviderUrl(), null, null);
   }
View Full Code Here

      }
   }
  
   private DeploymentManager createDeploymentManager(Server server) throws DeploymentManagerCreationException
   {
      DeploymentFactoryManager dfm = DeploymentFactoryManager.getInstance();
      return dfm.getDeploymentManager(server.getServerUrl(), null, null);
   }
View Full Code Here

   protected DeploymentManager initDeploymentManager(String factoryClass, String uri, String username, String password) throws Exception
   {
      if (deploymentManager == null)
      {
         DeploymentFactoryManager dfm = DeploymentFactoryManager.getInstance();
         dfm.registerDeploymentFactory(
               (DeploymentFactory) Class.forName(factoryClass).newInstance());
         deploymentManager =
               dfm.getDeploymentManager(uri, username, password);
      }
      return deploymentManager;
   }
View Full Code Here

    String getServerURI() {
        return auth.uri;
    }

    private void tryToConnect(String argURI, String driver, String user, String password, boolean authPrompt) throws DeploymentException {
        DeploymentFactoryManager mgr = DeploymentFactoryManager.getInstance();
        if(driver != null) {
            loadDriver(driver, mgr);
        } else {
            mgr.registerDeploymentFactory(new DeploymentFactoryImpl());
        }
        String useURI = argURI == null ? DEFAULT_URI : argURI;

        if(authPrompt && user == null && password == null) {
            File authFile = new File(System.getProperty("user.home"), ".geronimo-deployer");
            if(authFile.exists() && authFile.canRead()) {
                try {
                    Properties props = new Properties();
                    InputStream in = new BufferedInputStream(new FileInputStream(authFile));
                    props.load(in);
                    in.close();
                    String encryped = props.getProperty("login."+useURI);
                    if(encryped != null) {
                        if(encryped.startsWith("{Standard}")) {
                            SavedAuthentication auth = (SavedAuthentication) SimpleEncryption.decrypt(encryped.substring(10));
                            if(auth.uri.equals(useURI)) {
                                user = auth.user;
                                password = new String(auth.password);
                            }
                        } else if(encryped.startsWith("{Plain}")) {
                            int pos = encryped.indexOf("/");
                            user = encryped.substring(7, pos);
                            password = encryped.substring(pos+1);
                        } else {
                            System.out.println(DeployUtils.reformat("Unknown encryption used in saved login file", 4, 72));
                        }
                    }
                } catch (IOException e) {
                    System.out.println(DeployUtils.reformat("Unable to read authentication from saved login file: "+e.getMessage(), 4, 72));
                }
            }
        }

        if(authPrompt && !useURI.equals(DEFAULT_URI) && user == null && password == null) {
            // Non-standard URI, but no authentication information
            doAuthPromptAndRetry(useURI, user, password);
            return;
        } else { // Standard URI with no auth, Non-standard URI with auth, or else this is the 2nd try already
            try {
                manager = mgr.getDeploymentManager(useURI, user, password);
                auth = new SavedAuthentication(useURI, user, password == null ? null : password.toCharArray());
            } catch(AuthenticationFailedException e) { // server's there, you just can't talk to it
                if(authPrompt) {
                    doAuthPromptAndRetry(useURI, user, password);
                    return;
View Full Code Here

        new DeploymentFactoryImpl();

        ClassLoader oldcl = Thread.currentThread().getContextClassLoader();
        try {
            Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
            DeploymentFactoryManager factoryManager = DeploymentFactoryManager.getInstance();
            DeploymentManager manager = factoryManager.getDeploymentManager(getUri(), getUsername(), getPassword());
            return manager;
        } finally {
            Thread.currentThread().setContextClassLoader(oldcl);
        }
    }
View Full Code Here

      }
   }
  
   private DeploymentManager createDeploymentManager(Server server) throws DeploymentManagerCreationException
   {
      DeploymentFactoryManager dfm = DeploymentFactoryManager.getInstance();
      return dfm.getDeploymentManager(server.getServerUrl(), null, null);
   }
View Full Code Here

     *
     */
    public static synchronized void register() {
        // Register this deployment factory with the manager
        if (DISPLAY_NAME == null) {
            DeploymentFactoryManager manager = DeploymentFactoryManager.getInstance();
            manager.registerDeploymentFactory(new DeploymentFactoryImpl());
            Package pkg = DeploymentFactoryImpl.class.getPackage();
            if (pkg != null) {
                DISPLAY_NAME = pkg.getImplementationVendor();
                PRODUCT_VERSION = pkg.getImplementationVersion();
            }
View Full Code Here

TOP

Related Classes of javax.enterprise.deploy.shared.factories.DeploymentFactoryManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.