Package com.sun.enterprise.config.serverbeans

Examples of com.sun.enterprise.config.serverbeans.ApplicationRef


     * such be aware that bugs fixed here should be fixed there as well.
     */        
    private void deleteApplicationReferenceFromServer(Server server,
        String referenceName) throws ConfigException
    {       
        final ApplicationRef ref = server.getApplicationRefByRef(referenceName);
        if (ref == null) {
            //Application ref already exists in server        
            throw new ConfigException(_strMgr.getString("serverApplicationRefDoesNotExist",
                 server.getName(), referenceName));        
        }        
View Full Code Here


     */
    public static ApplicationRef findCurrentAppRef(
            DeploymentContext deploymentCtx,
            String targetName,
            String appName) throws ConfigException {
        ApplicationRef appRef = null;
        final ConfigContext configContext = deploymentCtx.getConfigContext();

        final Target target = TargetBuilder.INSTANCE.createTarget(
            targetTypes, targetName, configContext);

View Full Code Here

      String appRefXPath = ServerXPathHelper.getServerIdXpath(getInstanceName())
         + ServerXPathHelper.XPATH_SEPARATOR
         + ServerTags.APPLICATION_REF + "[@"
         + ServerTags.REF + "='" + standAloneModuleId + "']";

      ApplicationRef appRef = (ApplicationRef) ConfigBeansFactory.getConfigBeanByXPath(
                             getConfigContext(), appRefXPath);

            // if no virtual server, pick up first
            if (appRef.getVirtualServers()!=null) {
                return getHostAndPort(securityEnabled);
            }
           
      // Get the list of virtual servers from the Application Ref

      String appRefvs = null;
            List vsList = StringUtils.parseStringList(appRef.getVirtualServers(), " ,");
            if (vsList==null) {
                return getHostAndPort(securityEnabled);
            }
      ListIterator vsListIter = vsList.listIterator();
View Full Code Here

        Server server = null;
        try {
            ServerContext sCtx = ApplicationServer.getServerContext();
            server = ServerHelper.getServerByName(sCtx.getConfigContext(),
                                                  sCtx.getInstanceName());
            ApplicationRef aRef = server.getApplicationRefByRef(appId);
            if (aRef != null) {
                vs = aRef.getVirtualServers();
                if ((vs == null) || ( vs.length() == 0)) {
                    vs = WebServiceMgrBackEnd.DEFAULT_VIRTUAL_SERVER;
                }
            } else {
                    throw new IllegalArgumentException();
View Full Code Here

            }
            ConfigBean app = ApplicationHelper.findApplication(config,
                moduleName);
            Server server = ServerBeansFactory.getServerBean(config);
            ApplicationRef appRef = server.getApplicationRefByRef(moduleName);

            return ((app != null && app.isEnabled()) &&
                        (appRef != null && appRef.isEnabled()));
        } catch (ConfigException e) {
            _logger.log(Level.WARNING, "Error finding " + moduleName, e);

            //If there is anything wrong, do not enable the module
            return false;
View Full Code Here

        Servers servers = domain.getServers();
        Server server = servers.getServerByName(
                                _serverContext.getInstanceName());

        ApplicationRef ref = server.getApplicationRefByRef(appName);
        return (ref == null) ? false : true;
    }
View Full Code Here

                ConfigContext ctx = (ConfigContext)getConfigContext().clone();
                ConfigBean appBean =
                    ApplicationHelper.findApplication(ctx, entityName);
                appBean.setEnabled(true);
                Server server = ServerBeansFactory.getServerBean(ctx);
                ApplicationRef appRef =
                    server.getApplicationRefByRef(entityName);
                appRef.setEnabled(true);
                if (ctx.getConfigChangeList() != null &&
                    ctx.getConfigChangeList().size() > 0) {
                    event.addConfigChange(ctx.getConfigChangeList());
                    event.setTransient(true);
                }
View Full Code Here

       
        try {
            if (actionMBeanName != null) {
           
                Domain domain = ServerBeansFactory.getDomainBean(configCtx);
                ApplicationRef appRef = verifyActionMBean(actionMBeanName, domain,
                                                          ctxToUse);
      
      
                if (appRef != null) {
                    Applications apps = domain.getApplications();
                    Mbean definedMBean = apps.getMbeanByName(actionMBeanName);   
               
                  
                    if (appRef.isEnabled() && definedMBean.isEnabled() ) {
                        if ((definedMBean.getObjectType()).equals(USER_DEFINED_TYPE)) {
                            actionObjName = registerAction(ruleEvent,actionMBeanName,
                                                           definedMBean,false, handback);
                        } else {
                            // system defined, need to explictly load
View Full Code Here

     * @return ApplicationRef
     */
    private ApplicationRef verifyActionMBean(String actionMBeanName,
                                             Domain domain,
                                             ConfigContext ctxToUse) {
        ApplicationRef appRef = null;
        if (ctxToUse != null) {
           configCtx = ctxToUse;
        }
       
        try {
View Full Code Here

      ObjectName actionObjName = null;
      Object alertAction = null;   

      try {
          Domain domain = ServerBeansFactory.getDomainBean(ctxToUse);
          ApplicationRef appRef = verifyActionMBean(actionMBeanName, domain, ctxToUse);


          if (appRef != null) {
              Applications apps = domain.getApplications();
              Mbean definedMBean = apps.getMbeanByName(actionMBeanName);


              if (appRef.isEnabled() && definedMBean.isEnabled() ) {
                  if ((definedMBean.getObjectType()).equals(USER_DEFINED_TYPE)) {
                      actionObjName = registerAction(ruleEvent,actionMBeanName,
                                                     definedMBean,false,null);
                  } else {
                      // system defined, need to explictly load
View Full Code Here

TOP

Related Classes of com.sun.enterprise.config.serverbeans.ApplicationRef

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.