Package org.jvnet.glassfish.comms.deployment.backend

Examples of org.jvnet.glassfish.comms.deployment.backend.SipBundleDescriptor


        Iterator appModules = app.getModules();
        List result = new ArrayList();
        while (appModules.hasNext()) {
            ModuleDescriptor module = (ModuleDescriptor) appModules.next();
            if (SipUtil.SIP_MODULE_TYPE.equals(module.getModuleType().toString())) {
                SipBundleDescriptor desc = (SipBundleDescriptor) module.getDescriptor();
                HashMap oneRow = new HashMap();
                String componentName = module.getArchiveUri();
                if (componentName == null) {
                    componentName = "";
                }
                oneRow.put("componentName", componentName);

                String componentType = SipUtil.getMessage("sipModuleEdit.label");
                if (desc.isConverged()) {
                    componentType = SipUtil.getMessage("convergedSipModuleEdit.label");
                }
                oneRow.put("componentType", componentType);
                oneRow.put("javaWebStart", false);
                oneRow.put("downloadText", " ");
View Full Code Here


    /**
     * @return the descriptor instance to associate with this XMLNode
     */
    public Object getDescriptor() {
         if(descriptor==null){
        descriptor = new SipBundleDescriptor();
      }
        SipApplication sipApp = descriptor.getSipApplication();

        if (sipApp == null) {
            sipApp = new SipApplication();
View Full Code Here

    public void createRoleMapper(BundleDescriptor descriptor, String name) {

        if (descriptor instanceof SipBundleDescriptor) {

            SipBundleDescriptor sbd = (SipBundleDescriptor) descriptor;
            SunWebApp sunSipDesc = sbd.getSipApplication().getSunSipDescriptor();
            SecurityRoleMapping[] srmList = sunSipDesc.getSecurityRoleMapping();

            //SecurityRoleMapping[] srmList = ((WebBundleDescriptor) descriptor).getSunDescriptor().getSecurityRoleMapping();
            SecurityRoleMapperFactory factory = SecurityRoleMapperFactoryMgr.getFactory();
View Full Code Here

   
   
    public Map<String, String> readRunAs(BundleDescriptor descriptor, Map<String, String> srMap) {
        Map runAs = new HashMap<String,String>();
        if (descriptor instanceof SipBundleDescriptor) {
            SipBundleDescriptor sbd = (SipBundleDescriptor) descriptor;
            SunWebApp sunSipDesc = sbd.getSipApplication().getSunSipDescriptor();
            Servlet[] servlets = sunSipDesc.getServlet();
            if (servlets != null) {
                for (int i = 0; i < servlets.length; i++) {
                    Servlet servlet = servlets[i];
                    String prinName = servlet.getPrincipalName();
View Full Code Here

            listener.contextInitialized(servletContextEvent);
        }
    }

    private void postConfigureServletContextAttributes() {
        SipBundleDescriptor sbd = (SipBundleDescriptor) getDescriptor();

        SipApplicationListeners sipApplicationListeners = convergedContext.getSipApplicationListeners();

        InjectionUtil injectionUtil = new InjectionUtil();
       
View Full Code Here

            sipModuleName = sipApplication.getModuleID().substring(0, tmp.length() - 4);
        } else {
             sipModuleName = sipApplication.getModuleID();
        }               
       
        SipBundleDescriptor sbd = (SipBundleDescriptor) getDescriptor();
       
        /**
         * If there is no app-name specified in the sip.xml, then an app-name is
         *  generated. The logic is as follows :
         *  For an app within an .ear the app-name is <ear-name>/<war-name>
         *  For a standalone app the app-name is <war-name>
         */
        if(appName == null ) {
            if (sbd.getApplication() != null && !sbd.getApplication().isVirtual()) {           
                appName = sbd.getApplication().getRegistrationName() + "/" + sipModuleName ;
            } else {
                appName = sipModuleName;
            }
        }

View Full Code Here

        servletContext.setAttribute(UriTools.CONTEXT_ATTRIBUTE_NAME, DnsResolver.getInstance());

        //Make DataCentricUtil available for applications
        servletContext.setAttribute(DataCentricUtil.CONTEXT_ATTRIBUTE_NAME, DataCentricUtilHolder.getInstance());

        SipBundleDescriptor sbd = (SipBundleDescriptor) getDescriptor();

        for (Iterator itr = sbd.getJmsDestinationReferenceDescriptors().iterator();
                itr.hasNext();) {
            JmsDestinationReferenceDescriptor next = (JmsDestinationReferenceDescriptor) itr.next();

            String resourceType = next.getRefType();
View Full Code Here

     * Otherwise, we fall back to memory-only for both SIP and HTTP.
     */
    public void initializeConfiguration() {

        boolean isSipAppDistributable = false;
        SipBundleDescriptor sbd = null;
        if (_wbd instanceof SipBundleDescriptor) {
            sbd = (SipBundleDescriptor) _wbd;
            SipApplication sipApp = sbd.getSipApplication();

            if (sipApp != null) {
                isSipAppDistributable = ((SipApplication)sipApp).isDistributable();
            }

            if (sbd.isConverged()) {
                // Determine persistence configuration for HTTP
                super.initializeConfiguration();
            }
        }

        // Determine persistence configuration for SIP
        PersistenceType persistenceType = PersistenceType.MEMORY;
        String persistenceFrequency = null;
        String persistenceScope = null;

        boolean isAvailabilityEnabled = lookup.calculateSipAvailabilityEnabledFromConfig(_ctx);

        if (isAvailabilityEnabled) {
            // These are the global defaults if nothing is set at
            // domain.xml or sun-sip.xml
            persistenceType = PersistenceType.REPLICATED;
            persistenceFrequency = "sip-transaction";
            persistenceScope = "session";
        }

        // If domain.xml default exists, then use that
        PersistenceType domainPersistenceType = lookup.getSipPersistenceTypeFromConfig();

        if (domainPersistenceType != null) {
            persistenceType = domainPersistenceType;
            persistenceFrequency = lookup.getSipPersistenceFrequencyFromConfig();
            persistenceScope = lookup.getSipPersistenceScopeFromConfig();
        }

        // Consider persistence type, scope, and frequency from sun-sip.xml
        if (sipSmBean != null) {
            String pType = sipSmBean.getAttributeValue(
                SessionManager.PERSISTENCE_TYPE);
            persistenceType = PersistenceType.parseType(pType, persistenceType);

            String sipAppLevelPersistenceFrequency =
                getPersistenceFrequency(sipSmBean);
            if(sipAppLevelPersistenceFrequency != null) {
                persistenceFrequency = sipAppLevelPersistenceFrequency;
            }

            String sipAppLevelPersistenceScope =
                getPersistenceScope(sipSmBean);
            if(sipAppLevelPersistenceScope != null) {
                persistenceScope = sipAppLevelPersistenceScope;
            }
        }
       
        String frequency = null;
        String scope = null;

        // Deliberately leave frequency & scope null in memory-only case
        if (persistenceType != PersistenceType.MEMORY) {
            frequency = persistenceFrequency;
            scope = persistenceScope;
        }

        // If sip app is not distributable, and non-memory option
        // is attempted, log warning and set back to memory-only
        if (!isSipAppDistributable &&
                (persistenceType != PersistenceType.MEMORY)) {
            String sipAppName = getApplicationId(_ctx);

            // Suppress log warning for default-web-module
            // Log message only if availabilityenabled = true is attempted
            if (isAvailabilityEnabled &&
                    !sipAppName.equals(Constants.DEFAULT_WEB_MODULE_NAME) &&
                    !isSystemApp(sipAppName)) {
                SIP_LOGGER.log(Level.WARNING, "sipstack.invalid_session_manager_config",
                                   new Object[] { sipAppName, persistenceType.getType(),
                                   frequency, scope });
            }

            // Fall back to memory option
            persistenceType = PersistenceType.MEMORY;
            frequency = null;
            scope = null;
        }

        // If availability-enabled is false, reset to "memory"
        if (!isAvailabilityEnabled) {
            // Set back to memory option
            persistenceType = PersistenceType.MEMORY;
            frequency = null;
            scope = null;            
        }

        sipPersistenceType = persistenceType;
        sipPersistenceFrequency = frequency;
        sipPersistenceScope = scope;

        // Make sure that if the app is converged (i.e., contains both
        // a web.xml and sip.xml), and in-memory replication has been turned
        // on for SIP, it must also have been turned on for HTTP, and vice
        // versa.
        // Otherwise, we fall back to memory-only for both SIP and HTTP.
        if (sbd != null &&
                sbd.isConverged() &&
                (((sipPersistenceType == PersistenceType.REPLICATED) &&
                (_persistence != PersistenceType.REPLICATED)) ||
                ((sipPersistenceType != PersistenceType.REPLICATED) &&
                (_persistence == PersistenceType.REPLICATED)))) {
            SIP_LOGGER.log(Level.WARNING, "sipstack.inconsistent_persistence_type", getApplicationId(_ctx));
View Full Code Here

    public RealmAdapter(WebBundleDescriptor descriptor,
            boolean isSystemApp,
            String realmName) {
        super(descriptor, isSystemApp, realmName);
        if (descriptor instanceof SipBundleDescriptor) {
            SipBundleDescriptor sbd = (SipBundleDescriptor) descriptor;
            Iterator<String> itr = sbd.getServletsWithRunAs();
            while (itr.hasNext()) {
                String servletName = itr.next();
                String principal = sbd.getRunAsPrincipal(servletName);
                addRunAsPrincipal(servletName, principal);
            }

        }
    }
View Full Code Here

        {
          theirLog.log(Level.SEVERE, LOGPREFIX + "webBundleContext.getDescriptor() is not a SipBundleDescriptor");
            return getDefaultFailedResult();
        }
       
      SipBundleDescriptor sipBundleDescriptor = (SipBundleDescriptor) descrptor;
      SipApplication sipApplication = sipBundleDescriptor.getSipApplication();
      if ( sipApplication == null )
      {
        return getDefaultFailedResult();
      }
View Full Code Here

TOP

Related Classes of org.jvnet.glassfish.comms.deployment.backend.SipBundleDescriptor

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.