Package com.sun.enterprise.config

Examples of com.sun.enterprise.config.ConfigContext


   
    // check method called from the admin GUI and iasadmin
    public Result check(ConfigContextEvent ccce) {
        Result result = new Result();
        Object value = ccce.getObject();
        ConfigContext context = ccce.getConfigContext();
        String beanName = ccce.getBeanName();
        result.passed("Passed ***");

        //BUG 4739891 BEGIN
        String choice = ccce.getChoice();
View Full Code Here


   
     //check method called by iasadmin and adminGUI
     public Result check(ConfigContextEvent ccce) {
        Result result = new Result();
        result.passed("Passed **");
        ConfigContext context = ccce.getConfigContext();
        Object value = ccce.getObject();
        String choice = ccce.getChoice();
       
        String beanName = ccce.getBeanName();
        if(beanName!=null) {
               String name = ccce.getName();
               return testSave(name,(String)value);
        }
       
        JdbcConnectionPool pool = (JdbcConnectionPool)value;
        String poolName = pool.getName();
       
        // check if connction pool name is valid object name Bug : 4698687 : start
        if(StaticTest.checkObjectName(poolName, result))
            result.passed("Valid Object Name");
        else {
            result.failed("Connection Pool Name Invalid ");
            return result;
        }
        // End Bug : 4698687
       
        String datasourceClassname = pool.getDatasourceClassname();
       
        // to be uncommented once warning is implemented
        /*if(isInValidDataSource(result, datasourceClassname))
            return result;*/
       
        if (choice != null && choice.equals("DELETE")){
            try{
                    // 8.0 XML Verifier
                    //Server server = (Server)context.getRootConfigBean();
                    //Resources resource = server.getResources();
                    Domain domain = (Domain)context.getRootConfigBean();
                    Resources resource = domain.getResources();
                    JdbcResource[] jdbcResource = resource.getJdbcResource();
                    if(jdbcResource.length == 0)
                            result.passed("Connect Pool not used by data source");
                    for(int i=0;i<jdbcResource.length;i++){
View Full Code Here

        t.start();
    }

    static void init() {
        try {
            ConfigContext ctx =
                ApplicationServer.getServerContext().getConfigContext();
            ctx.refresh();
            ElementProperty[] eprops =
                ServerBeansFactory.getConfigBean(ctx).getLogService().getElementProperty();

            if (eprops != null) {
                for (int index = 0; index < eprops.length; index++) {
View Full Code Here

    }

    private void setupSocketListeners(ServerContext scontext)
    throws PortConflictException, com.sun.enterprise.config.ConfigException {

  ConfigContext ctxt = scontext.getConfigContext();
  conf = ServerBeansFactory.getConfigBean( ctxt );
 
  // Start HTTP listener ports
  HttpService httpService = conf.getHttpService();
        int backlog = 0;
View Full Code Here

        return wsMap;
    }

    private String getUriInDomainConfig(String appId) {
            ConfigContext configCtx = AdminService.getAdminService().
                getAdminContext().getAdminConfigContext();
        ConfigBean cb = null;
       
        try {
            cb = ApplicationHelper.findApplication(configCtx, appId);
View Full Code Here

  throws IASDeploymentException {

        // Flush config changes before sending the event. The events API
        // requires that config be saved prior to sending event.
        try {
            ConfigContext config =  getConfigContext();
            if (config != null && config.isChanged()) {
                config.flush();
            } else {
                // Server is initializing. Can not flush config changes.
            }
        } catch (ConfigException ce) {
            throw new IASDeploymentException(ce);
View Full Code Here

    }

    protected static void flushConfigAndSendEvents() throws Exception {
        AdminContext adminContext =
            AdminService.getAdminService().getAdminContext();
        ConfigContext ctx = adminContext.getAdminConfigContext();
                                                                               
        if (ctx.isChanged()) {
            ctx.flush();
        }
                                                                               
        new AdminNotificationHelper(adminContext).sendNotification();
    }
View Full Code Here

            return null;
        }
    }

    private static Applications getAppsConfigBean() throws ConfigException {
        ConfigContext configContext = getConfigContext();
        Domain domainConfig = ConfigAPIHelper.getDomainConfigBean(configContext);
        Applications appsConfig = domainConfig.getApplications();
        return appsConfig;
    }
View Full Code Here

    public static ConfigContext getConfigContext() {
        try {
            AdminService adminService = AdminService.getAdminService();
            if (adminService != null) {
                ConfigContext config =
                        adminService.getAdminContext().getAdminConfigContext();
                return config;
            } else {
               return null;
            }
View Full Code Here

    private static HostAndPort buildHostAndPortFromCurrentConfig(boolean securityEnabled) throws ConfigException {
        ServerContext serverContext = ApplicationServer.getServerContext();
        if (serverContext == null) {
            throw new IllegalStateException("Unable to locate server context");
        }
        ConfigContext configContext = serverContext.getConfigContext();
        if (configContext == null) {
            throw new IllegalStateException("Unable to locate config context from server");
        }
        return buildHostAndPortFromConfig(configContext, securityEnabled);
    }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.config.ConfigContext

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.