Package com.sun.enterprise.util.i18n

Examples of com.sun.enterprise.util.i18n.StringManager


    {
        //dbHome must exist and  have write permission
        final File fDBHome = new File(dbHome);
      String dbLogFileName = "";

        final StringManager lsm = StringManager.getManager(DerbyControl.class);
        if (fDBHome.isDirectory() && fDBHome.canWrite()) {
            final File fDBLog = new File(dbHome, DB_LOG_FILENAME);
          dbLogFileName = fDBLog.toString();

            //if the file exists, check if it is writeable
            if (fDBLog.exists() && !fDBLog.canWrite()) {
          System.out.println(lsm.getString("UnableToAccessDatabaseLog", dbLogFileName));
          System.out.println(lsm.getString("ContinueStartingDatabase"));
          //if exist but not able to write then create a temporary
          //log file and persist on starting the database
          dbLogFileName = createTempLogFile();
            }
            else if (!fDBLog.exists()) {
                //create log file
                fDBLog.createNewFile();
            }
        }
        else {
            System.out.println(lsm.getString("InvalidDirectory", dbHome));
          System.out.println(lsm.getString("ContinueStartingDatabase"));
          //if directory does not exist then create a temporary log file
          //and persist on starting the database
          dbLogFileName = createTempLogFile();
        }
        return dbLogFileName;
View Full Code Here


            final File fTemp = File.createTempFile("foo", null);
            fTemp.deleteOnExit();
          tempFileName = fTemp.toString();
      }
      catch (IOException ioe) {
            final StringManager lsm = StringManager.getManager(DerbyControl.class);
          throw new CommandException(lsm.getString("UnableToAccessDatabaseLog", tempFileName));
      }
        return tempFileName;
    }   
View Full Code Here

     * buildInternalCommand - This Method build san internal server command from domain.xml, so this
     * method is specifically used for server instances
     */
    public Command buildInternalCommand(String action) throws ConfigException
    {
        StringManager _strMgr=StringManager.getManager(ASLauncher.class);
       
        // derive domain.xml location and create config to be used by config api
        String domainXMLLocation=System.getProperty(SystemPropertyConstants.INSTANCE_ROOT_PROPERTY)
        + RELATIVE_LOCATION_DOMAIN_XML;
        //ConfigContext configCtxt=ConfigFactory.createConfigContext(domainXMLLocation);
View Full Code Here

            return;
       
        try {
            maker.join();
        } catch(InterruptedException e) {
            StringManager localStrings = StringManager.getManager( ClientJarMakerRegistry.class );           
            DeploymentLogger.get().log(Level.SEVERE,
                localStrings.getString("enterprise.deployment.error_creating_client_jar",
                    e.getLocalizedMessage()) ,e);           
        }
       
        return;
    }
View Full Code Here

                break;
            }
        }
     
        if(adminInterfaceFound == false) {
            StringManager localStrings =
                    StringManager.getManager(AdminObjectConfigParserImpl.class);
            String msg = localStrings.getString(
                    "no_adminobject_interface_found_in_raxml", adminObjectInterface);
            _logger.log(Level.FINE, msg);
            throw new ConnectorRuntimeException(msg);
        }
View Full Code Here

        final String          an = RelativePathResolver.getAlias(at);
        final String          sp = IdentityManager.getMasterPassword();
        final PasswordAdapter pa = new PasswordAdapter(sp.toCharArray()); // use default password store
        final boolean     exists = pa.aliasExists(an);
        if (!exists) {
            final StringManager lsm = StringManager.getManager(RelativePathResolver.class);
            final String msg = lsm.getString("no_such_alias", an, at);
            throw new IllegalArgumentException(msg);
        }
        final String real = pa.getPasswordForAlias(an);
        return ( real );
    }   
View Full Code Here

        ConnectionSource dasConnection= (ConnectionSource) args[0];
        SunTarget[] targets = (SunTarget[]) args[1];
        moduleID = (String) args[2];
        CommandType newState = (CommandType) args[3];
        SunTarget domain = (SunTarget) args[4];
        StringManager localStrings = StringManager.getManager(getClass());

        ModuleType moduleType;
        try {
            moduleType = DeploymentClientUtils.getModuleType(
                dasConnection.getExistingMBeanServerConnection(), moduleID);
        } catch (Throwable ioex) {
            finalDeploymentStatus.setStageException(ioex);
            setupForAbnormalExit(localStrings.getString("enterprise.deployment.client.unrecognized_module_type", moduleID ,ioex.getMessage()),
                        domain);
            return;
        }
       
        boolean state = false;
        String action = "Disable";
        if (CommandType.START.equals(newState)) {
            state = true;
            action = "Enable";
        }

        // the target module ids in which the operation was successful
        ArrayList resultTargetModuleIDs = new ArrayList();            

        for(int i=0; i<targets.length; i++) {
            DeploymentStatus stat = new DeploymentStatus();
            stat.setStageDescription(
                localStrings.getString("enterprise.deployment.client.state_change_desc", action, moduleID));
            try {
                /*
                 *If the module type supports state changes, change the state.
                 *Otherwise prepare a warning status with a "no-op" message.
                 */
                String messageKey;
                int deplStatus;
                if (! unchangeableStateModuleTypes.contains(moduleType)) {
                    messageKey = "enterprise.deployment.client.state_change_success";
                    deplStatus = DeploymentStatus.SUCCESS;
                   
                    DeploymentClientUtils.changeStateOfModule(dasConnection.getExistingMBeanServerConnection(), moduleID,
                                    ((moduleType == null) ? null : moduleType.toString()), targets[i], state);
                } else {
                    messageKey = "enterprise.deployment.client.state_change_noop";
                    deplStatus = DeploymentStatus.SUCCESS;
                }
                stat.setStageStatus(deplStatus);
                stat.setStageStatusMessage(localStrings.getString(messageKey, action, moduleID));
            } catch (Throwable ex) {
                String msg;
                if (CommandType.START.equals(newState)) {
                    msg = localStrings.getString(
                        "enterprise.deployment.client.start.failed");
                } else {
                    msg = localStrings.getString(
                        "enterprise.deployment.client.stop.failed");
                }
                stat.setStageException(ex);
                stat.setStageStatus(DeploymentStatus.FAILURE);
                stat.setStageStatusMessage(msg + ex.getMessage());
            }
            if(!checkStatusAndAddStage(targets[i], null,
                            localStrings.getString("enterprise.deployment.client.change_state", action, moduleID, targets[i].getName()), dasConnection, stat, state)) {
                return;
            }
            resultTargetModuleIDs.add(new SunTargetModuleID(moduleID, targets[i]));
        }

        // initialize the instance variable targetModuleIDs using
        // the successful module ids
        this.targetModuleIDs = new TargetModuleID[resultTargetModuleIDs.size()];
        this.targetModuleIDs =
            (TargetModuleID[])resultTargetModuleIDs.toArray(this.targetModuleIDs);

        setupForNormalExit(localStrings.getString("enterprise.deployment.client.change_state_all", action), domain);
    }
View Full Code Here

        }
        String auth = ref.getAuthorization();
 
        if (auth.equals(ref.APPLICATION_AUTHORIZATION) ) {
      if (cxRequestInfo == null ) {
                StringManager localStrings =
                    StringManager.getManager(ConnectionManagerImpl.class);
          String msg = localStrings.getString(
        "con_mgr.null_userpass");
          throw new ResourceException( msg );
      }
            ConnectorRuntime.getRuntime().switchOnMatching(rarName, poolName);
            return internalGetConnection(mcf, null, cxRequestInfo,
View Full Code Here

                                               desc);
                return poolmgr.getResource(spec, alloc, info);
               
            case ConnectorConstants.LOCAL_TRANSACTION_INT:
                if (!shareable) {
                    StringManager localStrings =
                        StringManager.getManager(ConnectionManagerImpl.class);
        String i18nMsg = localStrings.getString(
            "con_mgr.resource_not_shareable");
        throw new ResourceAllocationException( i18nMsg )
                }
                alloc =
                    new LocalTxConnectorAllocator(poolmgr, mcf, spec,
                                                  subject, cxRequestInfo,
                                                  info, desc);
                return poolmgr.getResource(spec, alloc, info);
            case ConnectorConstants.XA_TRANSACTION_INT:
                if (rarName.equals(ConnectorRuntime.DEFAULT_JMS_ADAPTER)) {
                    shareable = false;
                }
    spec.markAsXA();
                alloc =
                    new ConnectorAllocator(poolmgr, mcf, spec,
                                           subject, cxRequestInfo, info, desc,
                                           shareable);
                return poolmgr.getResource(spec, alloc, info);
            default:
                StringManager localStrings =
                    StringManager.getManager(ConnectionManagerImpl.class);
          String i18nMsg = localStrings.getString(
        "con_mgr.illegal_tx_level",  txLevel+ " ");
                throw new IllegalStateException(i18nMsg);
            }

        } catch (PoolingException ex) {
             Object[]  params = new Object[]{poolName, ex.getMessage()};
            _logger.log(Level.WARNING,"poolmgr.get_connection_failure",params);
            StringManager localStrings =
                StringManager.getManager(ConnectionManagerImpl.class);
            String i18nMsg = localStrings.getString(
          "con_mgr.error_creating_connection", ex.getMessage() );
            ResourceAllocationException rae = new ResourceAllocationException(
          i18nMsg );
      rae.initCause( ex );
            throw rae;
View Full Code Here

    }
   
    private void validatePool() throws ResourceException{
        ConnectorRegistry registry = ConnectorRegistry.getInstance();
        if (registry.getPoolMetaData(poolName) == null){
            StringManager localStrings =
                StringManager.getManager(ConnectionManagerImpl.class);
            String msg = localStrings.getString("con_mgr.no_pool_meta_data", poolName);
            throw new ResourceException(poolName + ": " + msg);
            }
    }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.util.i18n.StringManager

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.