Examples of DeploymentFactoryManager


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

       
        ClownfishHelper clownfishHelper = EasyMock.createMock(
                ClownfishHelper.class);
       
       
        DeploymentFactoryManager deploymentFactoryManager
                = DeploymentFactoryManager.getInstance();
       
        DeploymentFactory deploymentFactory = new MyDeploymentFactory();
        DeploymentManager deploymentManager = new MyDeploymentManager();
       
View Full Code Here

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

    /**
     * Test load and register deployment factory failure.
     */
    public void testLoadAndRegisterDeploymentFactoryFailure() {
       
        DeploymentFactoryManager deploymentFactoryManager
                = DeploymentFactoryManager.getInstance();
       
        try {
            clownfishHelper.loadDeploymentManager(
                    deploymentFactoryManager, null);
View Full Code Here

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

            // do-nothing
        }
       
       
       
        DeploymentFactoryManager deploymentFactoryManager
                = DeploymentFactoryManager.getInstance();
       
        try {
            clownfishHelper.loadDeploymentManager(
                    deploymentFactoryManager, null);
View Full Code Here

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

     * Test init.
     */
    @Test
    public void testInit() {
       
        DeploymentFactoryManager deploymentFactoryManager
                = DeploymentFactoryManager.getInstance();
       
        DeploymentFactory deploymentFactory = new MyDeploymentFactory();
        deploymentManager = new MyDeploymentManager();
       
View Full Code Here

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

       
        ClownfishHelper clownfishHelper = EasyMock.createMock(
                ClownfishHelper.class);
       
       
        DeploymentFactoryManager deploymentFactoryManager
                = DeploymentFactoryManager.getInstance();
       
        DeploymentFactory deploymentFactory = new MyDeploymentFactory();
        DeploymentManager deploymentManager = new MyDeploymentManager();
       
View Full Code Here

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

     * Test load and register deployment factory failure.
     */
    @Test(expected = IllegalArgumentException.class)
    public void testLoadAndRegisterDeploymentFactoryFailure() {
       
        DeploymentFactoryManager deploymentFactoryManager
                = DeploymentFactoryManager.getInstance();
       
        clownfishHelper.loadDeploymentManager(
                deploymentFactoryManager, null);
    }
View Full Code Here

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

     * Test load deployment manager with null command.
     */
    @Test(expected = IllegalArgumentException.class)
    public void testLoadDeploymentManagerNullCommand() {
       
        DeploymentFactoryManager deploymentFactoryManager
                = DeploymentFactoryManager.getInstance();
       
        clownfishHelper.loadDeploymentManager(deploymentFactoryManager, null);
    }
View Full Code Here

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

    public static ApplicationInfo createApplicationInfo(PortletRequest actionRequest, File moduleFile) {
        ApplicationInfo applicationInfo = null;
        EARConfigBuilder.createPlanMode.set(Boolean.TRUE);
        try {
            DeploymentFactoryManager dfm = DeploymentFactoryManager.getInstance();
            DeploymentManager mgr = dfm.getDeploymentManager("deployer:geronimo:inVM", null, null);
            if (mgr instanceof JMXDeploymentManager) {
                ((JMXDeploymentManager) mgr).setLogConfiguration(false, true);
            }
            Target[] targets = mgr.getTargets();
            if (null == targets) {
View Full Code Here

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

    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

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

    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(geronimoDeploymentFactory);
        }
        String useURI = argURI == null ? DEFAULT_URI : argURI;

        if (authPrompt && user == null && password == null) {
            InputStream in;
            // First check for .geronimo-deployer on class path (e.g. packaged in deployer.jar)
            in = ServerConnection.class.getResourceAsStream("/.geronimo-deployer");
            // If not there, check in home directory
            if (in == null) {
                File authFile = new File(System.getProperty("user.home"), ".geronimo-deployer");
                if (authFile.exists() && authFile.canRead()) {
                    try {
                        in = new BufferedInputStream(new FileInputStream(authFile));
                    } catch (FileNotFoundException e) {
                        // ignore
                    }
                }
            }
            if (in != null) {
                try {
                    Properties props = new Properties();
                    props.load(in);
                    String encrypted = props.getProperty("login." + useURI);
                    if (encrypted != null) {

                        if (encrypted.startsWith("{Plain}")) {
                            int pos = encrypted.indexOf("/");
                            user = encrypted.substring(7, pos);
                            password = encrypted.substring(pos + 1);
                        } else {
                            Object o = EncryptionManager.decrypt(encrypted);
                            if (o == encrypted) {
                                System.out.print(DeployUtils.reformat("Unknown encryption used in saved login file", 4, 72));
                            } else {
                                SavedAuthentication auth = (SavedAuthentication) o;
                                if (auth.uri.equals(useURI)) {
                                    user = auth.user;
                                    password = new String(auth.password);
                                }
                            }
                        }
                    }
                } catch (IOException e) {
                    System.out.print(DeployUtils.reformat("Unable to read authentication from saved login file: " + e.getMessage(), 4, 72));
                } finally {
                    try {
                        in.close();
                    } catch (IOException e) {
                        // ingore
                    }
                }
            }
        }

        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
TOP
Copyright © 2018 www.massapi.com. 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.