Package com.sun.enterprise.ee.synchronization

Examples of com.sun.enterprise.ee.synchronization.SynchronizationException


                "synchronization.file_received", _request.getMetaFileName());

        } catch (Exception e) {
            String msg = _localStrMgr.getString("fileRetrieveError"
                       , _request.getMetaFileName());
            throw new SynchronizationException(msg, e);

        } finally {
            try {
                if (bis != null) {
                    bis.close();
                }
            } catch (Exception e) { }

            try {
                if (conn != null) {
                    ((HttpURLConnection) conn).disconnect();
                }
            } catch (Exception e) { }
        }

        if (_result == null) {
            String msg = _localStrMgr.getString("fileRetrieveError"
                       , _request.getMetaFileName());
            throw new SynchronizationException(msg);
        }
    }
View Full Code Here


            zipFile.getEntry(ServletProcessor.RESPONSE_ENTRY_NAME);

        if (response == null) {
            String msg = _localStrMgr.getString("responseEntryNotFound",
                                            _request.getMetaFileName());
            throw new SynchronizationException(msg);
        }

        InputStream zis      = null;
        ObjectInputStream in = null;
View Full Code Here

                // since initializing with a connection already
                isConnectNeeded = false;
                jmxFileTrans.setTargetServer(instanceName);
            } catch (InstanceException ie) {
                throw new SynchronizationException(
                   _strMgr.getString("synchronization.api.conn_reg_get_failed",
                            instanceName),ie);
            } catch (IOException ioe) {
                throw new SynchronizationException(
                    _strMgr.getString("synchronization.api.jmx_ctor_failed",
                            instanceName),ioe);
            }
        } else { // A server connecting to DAS or another server.           
            String url =null;

            String user = IdentityManager.getUser();
            if (user == null ) {
                String msg =_localStrMgr.getString("ClientUserNotFound",
                    instanceName);
                throw new RuntimeException(msg);
            }
                   
            String password = IdentityManager.getPassword();
            if (password == null) {
                String msg =_localStrMgr.getString("PassWordNotFound",
                    instanceName);
                throw new RuntimeException(msg);
            }                       
           
            // connecting to DAS. Using DAS property reader
            if ( SystemPropertyConstants.DEFAULT_SERVER_INSTANCE_NAME.compareTo(
                    instanceName) == 0 ) {
               DASPropertyReader dpr = new DASPropertyReader(
                            new InstanceConfig());

                try {
                    dpr.read();
                } catch (IOException ioe) {
                    String msg = _localStrMgr.getString("DASPropReadNotFound");
                    throw new SynchronizationException(msg);
                }
                url = dpr.getJMXURL();               
            }
            else {
                try {
                    ConfigContext cfgCtx = ApplicationServer.getServerContext().
                                                getConfigContext();
                    assert(cfgCtx != null);
                    JMXConnectorConfig jmxConfig = ServerHelper.
                        getJMXConnectorInfo(cfgCtx, instanceName);
                    if ( jmxConfig == null ) {
                        String msg = _localStrMgr.getString("JMXInfoNotFound",
                            instanceName);
                        throw new RuntimeException(msg);
                    }                                      


        /* Need a better way of handling connector configuration */
                    final JMXServiceURL theUrl =
                    JmxServiceUrlFactory.forRmiWithJndiInAppserver(
                        jmxConfig.getHost(),
                        Integer.parseInt(jmxConfig.getPort()));
                    url = theUrl.toString();
                } catch (ConfigException ce) {
                    throw new SynchronizationException(
                    _strMgr.getString(
                        "synchronization.api.jmx_config_ctor_failed",
                      instanceName),ce);
                }
            }
            try {
                JMXServiceURL jmxurl = new JMXServiceURL(url);
                jmxFileTrans=new JMXFileTransfer(jmxurl, user, password, false);
                isConnectNeeded = true;
                assert(jmxFileTrans != null);
                jmxFileTrans.setTargetServer(instanceName);
            } catch (IOException ie) {
               throw new SynchronizationException(
                    _strMgr.getString("synchronization.api.jmx_ctor_failed",
                            instanceName),ie);
            }
        }
    }
View Full Code Here

            boolean allowAbsolutePath) throws  SynchronizationException {

        if ( (jmxFileTrans == null )
                || (jmxFileTrans.getMBeanServerConnection() == null)) {
               
            throw new SynchronizationException(
                _strMgr.getString("synchronization.api.connect_error"));
        }

        String relFile =  getRelativeDir(remoteFile);

        if (relFile == null ) {
            throw new SynchronizationException(_localStrMgr.getString(
                "NotValidParamString", remoteFile));
        } else {
            remoteFile = relFile;
        }

        // allows absolute path only if the flag is set to true
        if (!allowAbsolutePath) {
            if ( new File(remoteFile).isAbsolute() ) {
                 throw new SynchronizationException(
                   _strMgr.getString("synchronization.api.no_absolute",
                   remoteFile));
            }
        }

        try {
            if (!localFile.exists() )
                localFile.createNewFile();
        } catch( IOException ioe) {
            throw new SynchronizationException( _strMgr.getString(
                        "synchronization.api.create_local_file_failed",
                            localFile.getName()), ioe);
        }
        try {
            jmxFileTrans.mcDownloadFile(remoteFile, localFile);
        } catch( IOException e) {
            throw new SynchronizationException( _strMgr.getString(
                        "synchronization.api.transfer_exception",
                            remoteFile), e);
        }
    }
View Full Code Here

        String resolvedFile = RelativePathResolver.resolvePath(localFile);

        if (resolvedFile == null) {
            String msg = _localStrMgr.getString("NotValidResolveString",
                                localFile);
            throw new SynchronizationException(msg);
        }

        File f = new File(resolvedFile);
        get(remoteFile, f);
    }
View Full Code Here

            throws  SynchronizationException{

        String relFile =  getRelativeDir(remoteDir);

        if (relFile == null ) {
            throw new SynchronizationException(_localStrMgr.getString(
                "NotValidParamString", remoteDir));
        } else {
            remoteDir = relFile;
        }

        if ( new File(remoteDir).isAbsolute() )
             throw new SynchronizationException(
               _strMgr.getString("synchronization.api.no_absolute",remoteDir));

        if ( (jmxFileTrans == null ) || (jmxFileTrans.getMBeanServerConnection()                                             == null))
                throw new SynchronizationException(
                    _strMgr.getString("synchronization.api.connect_error"));
        try {

            return jmxFileTrans.uploadFile(localFile, remoteDir);
        } catch(IOException e) {
            throw new SynchronizationException( _strMgr.getString(
                        "synchronization.api.transfer_exception",
                            remoteDir), e);
        }

    }
View Full Code Here

        String resolvedFile = RelativePathResolver.resolvePath(localFile);

        if (resolvedFile == null) {
            String msg = _localStrMgr.getString("NotValidResolveString",
                            localFile);
            throw new SynchronizationException(msg);
        }
        File f = new File(resolvedFile);
        return put(f, remoteDir);
    }
View Full Code Here

                    "synchronization.done.keyfile.connect",dasName);
        try {
            sc.connect();
        } catch (IOException ie) {
           String msg = _localStrMgr.getString("ConnectFailedDAS");
           throw new SynchronizationException(msg);
        }

        // current server name
        String serverName=ApplicationServer.getServerContext().
                            getInstanceName();
        if (serverName == null) {
            String msg = _localStrMgr.getString("CurrInstanceError");
           throw new RuntimeException(msg);
        }

        // "${com.sun.aas..instanceRoot}/config/keyfile"
        String keylocation = getLocation(serverName, realmName)

        _logger.log(Level.FINEST,
                    "synchronization.done.keyfile.getloc",serverName);

        // Properties array-- right now includes instanceRoot
        String []props = new String[1];
        props[0] = SystemPropertyConstants.INSTANCE_ROOT_PROPERTY;

        String src = RelativePathResolver.unresolvePath(keylocation, props);
        if (src == null) {
            String msg=_localStrMgr.getString("UnresolvePathError",keylocation);
            throw new RuntimeException(msg);
        }

        _logger.log(Level.FINEST,_strMgr.getString(
                    "synchronization.done.keyfile.unresolve",keylocation, src));

        sc.get(src, keylocation);
        _logger.log(Level.FINEST,
                    "synchronization.done.keyfile.get",keylocation);
        try {
            sc.disconnect();
        } catch (IOException ie) {
           String msg = _localStrMgr.getString("DisConnectFailedDAS");
           throw new SynchronizationException(msg);
        }
        _logger.log(Level.FINE,
                    "synchronization.done.keyfile.download",keylocation);

    }
View Full Code Here

        ConfigBean bean = null;
        try {
            bean = ApplicationHelper.findApplication(_ctx, name);
        } catch (ConfigException ce) {
            String msg=_localStrMgr.getString("UnknownApplicationId", name);
            throw new SynchronizationException(msg, ce);
        }

        // delegate to the correct method
        if (bean instanceof J2eeApplication) {
            synchronizeJ2EEApplication(name);
        } else if (bean instanceof AppclientModule) {
            synchronizeAppclientModule(name);
        } else if (bean instanceof EjbModule) {
            synchronizeEJBModule(name);
        } else if (bean instanceof LifecycleModule) {
            synchronizeLifecycleModule(name);
        } else if (bean instanceof WebModule) {
            synchronizeWebModule(name);
        } else if (bean instanceof ConnectorModule) {
            synchronizeConnectorModule(name);
        } else if (bean instanceof ExtensionModule) {
            synchronizeExtensionModule(name);
        } else {
            // unknown bean type
            String msg=_localStrMgr.getString("UnknownApplicationType", name);
            throw new SynchronizationException(msg);
        }
    }
View Full Code Here

            app = ((Domain)_ctx.getRootConfigBean()).
                                    getApplications().
                                    getJ2eeApplicationByName(appName);
        } catch (ConfigException ce) {
            String msg=_localStrMgr.getString("UnknownApplicationId", appName);
            throw new SynchronizationException(msg, ce);
        }

        ApplicationRequestBuilder appReqBuilder =
             new ApplicationRequestBuilder(_ctx,_serverName);
View Full Code Here

TOP

Related Classes of com.sun.enterprise.ee.synchronization.SynchronizationException

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.