Package com.sun.enterprise

Examples of com.sun.enterprise.Switch


        Invocation inv = null;
        Container container = null;

        try {

            Switch theSwitch = Switch.getSwitch();
            InvocationManager invManager = theSwitch.getInvocationManager();
            inv = (Invocation) invManager.getCurrentInvocation();
            container = (Container) inv.container;

            inv.method = wsUtil.getInvMethod(inv.getWebServiceTie(), context);
View Full Code Here


    public boolean handleRequest(MessageContext context) {
        Invocation inv = null;
        boolean continueProcessing = true;

        try {
            Switch theSwitch = Switch.getSwitch();
            InvocationManager invManager = theSwitch.getInvocationManager();
            inv = (Invocation) invManager.getCurrentInvocation();
            Container container = (Container) inv.container;

            Method webServiceMethodInPreHandler = inv.getWebServiceMethod();
View Full Code Here

                       ejbEndpoint.getEndpoint().getEndpointName() + ". " +
                       "Expected " + expectedScheme + " . Received " + scheme);
            return;
        }

        Switch theSwitch = Switch.getSwitch();
        Container container = ejbEndpoint.getContainer();
       
        boolean authenticated = false;
        try {
            // Set context class loader to application class loader
View Full Code Here

    public boolean handleRequest(MessageContext context) {
        ComponentInvocation inv = null;

        try {
            Switch theSwitch = Switch.getSwitch();
            InvocationManager invManager = theSwitch.getInvocationManager();
            inv = invManager.getCurrentInvocation();

            Method webServiceMethodInPreHandler = inv.getWebServiceMethod();
            if( webServiceMethodInPreHandler != null ) {
                Method postHandlerMethod =
View Full Code Here

    try {
      Utility.checkJVMVersion();
      // Initialize the ORB if not already started.
      ORBManager.getORB() ;

      Switch theSwitch = Switch.getSwitch();
      NamingManager nm = new NamingManagerImpl();
      theSwitch.setNamingManager(nm);
     
      RealmManager mgr = new RealmManager();
      mgr.init(); // Initialize the Authentication Service ...
      mgr.start(); // Start the Server.
        } catch (Exception ex) {
View Full Code Here

    }
   
    public void generateFinalWsdl(URL wsdlFileUrl, WebService webService, WebServerInfo wsi,
                                  OutputStream outputStream) throws Exception {
                                     
        Switch theSwitch = Switch.getSwitch();

        String webServiceName = webService.getName();

        Collection wsdlRelativeImports = new HashSet();
        Collection wsdlIncludes = new HashSet();
View Full Code Here

     * @throws NamingException for errors creating the InitialContext
     */
    public static InitialContext initializeNaming(Properties iiopProperties) throws NamingException {
        InitialContext result = new InitialContext(iiopProperties);
       
        Switch sw = Switch.getSwitch();
       
  InvocationManager im = new InvocationManagerImpl();
  sw.setInvocationManager(im);

        /* Create the naming manager and set it in the switch before the xn svc. */
  sw.setNamingManager(new NamingManagerImpl(result));

  // Initialize Transaction service. By now the ORB must have
  // been created during the new InitialContext() call using
  // the ORBManager
  PEORBConfigurator.initTransactionService(null, new Properties() );
 
  /* Create the transaction manager and set it in the switch. */
  // J2EETransactionManager tm = new J2EETransactionManagerImpl();
  J2EETransactionManager tm =
    J2EETransactionManagerImpl.createTransactionManager();
  sw.setTransactionManager(tm);

        // Create the Injection Manager and set it on the switch.
        InjectionManager injectionMgr = new InjectionManagerImpl();
        sw.setInjectionManager(injectionMgr);              

        return result;
    }
View Full Code Here

  // we should try to replace this endpoint specific
  // authorization check with a generic web service message check
  // and move the endpoint specific check down stream
  if (isEjbEndpoint) {

      Switch theSwitch = Switch.getSwitch();
      InvocationManager invManager= theSwitch.getInvocationManager();
      Invocation inv= (Invocation) invManager.getCurrentInvocation();
            // one need to copy message here, otherwise the message may be
            // consumed
            inv.setMessage(request.getMessage().copy());
      Exception ie = null;
View Full Code Here

            throw cre;
        }
    }
   
    private void initialize() {
        Switch sw = Switch.getSwitch();
  if (sw.getContainerType() == ConnectorConstants.NON_ACC_CLIENT) {
            //Invocation from a non-ACC client
      try {
          if (sw.getPoolManager() == null) {
        sw.setPoolManager(new PoolManagerImpl());
    }

          if (sw.getNamingManager() == null) {
        sw.setNamingManager(new NamingManagerImpl());
    }
      } catch(Exception e) {
                _logger.log( Level.WARNING, e.getMessage());
      }
  }
View Full Code Here

            parentLoader = _serverContext.getSharedClassLoader();
        }
        ctx.setParentClassLoader(parentLoader);

        Throwable exception = null;
        Switch sw = Switch.getSwitch();
        try{
            // Determine if an alternate DD is set for this web-module in
            // the application
            if (wbd != null) {
                String altDDName = wbd.getModuleDescriptor().
                                        getAlternateDescriptor();
                if (altDDName != null) {
                    // we should load the alt dd from generated/xml directory
                    // first, then fall back to original app location.

                    // if we have alt dd, it must be an embedded web module
                    String appName =  wmName.substring(0,
                        wmName.indexOf(Constants.NAME_SEPARATOR));
                    String appLoc =
                        appsManager.getGeneratedXMLLocation(appName);
                    if (! FileUtils.safeIsDirectory(appLoc)) {
                        appLoc = wmInfo.getLocation()+"/..";
                    }

                    if (altDDName.startsWith("/")) {
                        altDDName = appLoc+altDDName.trim();
                    }
                    else {
                        altDDName = appLoc+"/"+altDDName.trim();
                    }
                    Object[] objs = {altDDName, wmName};
                    _logger.log(Level.INFO, "webcontainer.altDDName", objs);
                    ctx.setAltDDName(altDDName);

                }
                // time to update the Web Services related information in
                // our runtime jsr77 mbeans. We publish two extra properties
                // hasWebServices and endpointAddresses for webservices
                // enable web applications.
                if (wbd.hasWebServices()) {
                    ctx.setHasWebServices(true);
                   
                    // creates the list of endpoint addresses
                    String[] endpointAddresses;
                    WebServicesDescriptor webService = wbd.getWebServices();
                    Vector endpointList = new Vector();
                    for (Iterator endpoints = webService.getEndpoints().iterator();
                    endpoints.hasNext();) {
                        WebServiceEndpoint wse = (WebServiceEndpoint) endpoints.next();
                        if (wbd.getContextRoot()!=null) {
                            endpointList.add(wbd.getContextRoot() + "/"
                                             + wse.getEndpointAddressUri());
                        } else {
                            endpointList.add(wse.getEndpointAddressUri());
                        }
                    }
                    endpointAddresses = new String[endpointList.size()];
                    endpointList.copyInto(endpointAddresses);
                   
                    ctx.setEndpointAddresses(endpointAddresses);
                   
                } else {
                    ctx.setHasWebServices(false);
                }
            }

            // Object containing sun-web.xml information
            SunWebApp iasBean = null;

            // The default context is the only case when wbd == null
            if (wbd != null)
                iasBean = wbd.getSunDescriptor();

            // set the sun-web config bean
            ctx.setIasWebAppConfigBean(iasBean);
            ctx.setID(wmName);

            // Configure SingleThreadedServletPools, work/tmp directory etc
            configureMiscSettings(ctx, iasBean, vs, displayContextPath);
          
            // Configure alternate docroots if dummy web module
            if (Constants.DEFAULT_WEB_MODULE_NAME.equals(ctx.getID())) {
                ctx.setAlternateDocBases(vs.getProperties());
            }
         
            // Configure the class loader delegation model, classpath etc
            Loader loader = configureLoader(ctx, iasBean, wmInfo);
           
            // Set the class loader on the DOL object
            if (wbd != null && wbd.hasWebServices())
                wbd.addExtraAttribute("WEBLOADER", loader);

            // Enable dynamic reloading only for Web Modules
            if ( wmInfo.getBean() instanceof
                     com.sun.enterprise.config.serverbeans.WebModule &&
                                                       _reloadingEnabled) {
               
                if (_reloadManager == null) {
                    _reloadManager = new StandaloneWebModulesManager(
                                                            _id,
                                                            _modulesRoot,
                                                            _pollInterval);
                }
                _reloadManager.addWebModule((com.sun.enterprise.config.serverbeans.WebModule)wmInfo.getBean());
           
             }

            // Configure the session manager and other related settings
            // HERCULES:mod - take into account if app is distributable
            // passing in WebBundleDescriptor which has info about whether
            // app is distributable
            ctx.configureSessionSettings(wbd, wmInfo);
            // END HERCULES:mod

            // set i18n info from locale-charset-info tag in sun-web.xml
            ctx.setI18nInfo();


            if (wbd != null) {
                String resourceType = null;
                if(wmInfo.getBean() instanceof
                             com.sun.enterprise.config.serverbeans.WebModule) {
                    resourceType =
                     ((com.sun.enterprise.config.serverbeans.WebModule)wmInfo.
                                                     getBean()).getObjectType();
                } else {
                    resourceType = ((ExtensionModule)wmInfo.getBean()).
                                                           getObjectType();
                }
                boolean isSystem = (resourceType != null &&
                    resourceType.startsWith("system-"));
                if ("null".equals(j2eeApplication)) {
                    /*
                     * Standalone webapps inherit the realm referenced by
                     * the virtual server on which they are being deployed,
                     * unless they specify their own
                     */ 
                    ctx.setRealm(getRealmAdapter(wbd, isSystem,  vs.getAuthRealmName()));
                } else {
                        ctx.setRealm(getRealmAdapter(wbd, isSystem, null));
                }
                configureSecurity(wbd, isSystem);
                sw.setDescriptorFor(ctx, wbd);

                // post processing DOL object for standalone web module
                if (wbd.getApplication() != null &&
                    wbd.getApplication().isVirtual()) {
                    wbd.visit((WebBundleVisitor) new WebValidatorWithoutCL());
View Full Code Here

TOP

Related Classes of com.sun.enterprise.Switch

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.