Examples of StaticApplicationContext


Examples of com.sun.xml.wss.impl.configuration.StaticApplicationContext

       
        ProcessingContext context = null;
        SOAPMessage message =  packet.getMessage().readAsSOAPMessage();
        try {
           
            StaticApplicationContext sContext =
                    new StaticApplicationContext(getPolicyContext(packet));
           
            context = new ProcessingContextImpl(packet.invocationProperties);
           
            context.setSOAPMessage(message);
           
            String operation = getOperationName(message);
           
            ApplicationSecurityConfiguration _sConfig =
                    config.getSecurityConfiguration();
           
            if (operation.equals(ENCRYPTED_BODY_QNAME) &&
                    _sConfig.hasOperationPolicies()) {
                // get enclosing port level configuration
                if (MessageConstants.debug) {
                    System.out.println("context in plugin= " +
                            sContext.toString());
                }
                ApplicationSecurityConfiguration appconfig =
                        (ApplicationSecurityConfiguration)
                        _sConfig.getSecurityPolicies(sContext).next();
               
                if (appconfig != null) {
                    context.setPolicyContext(sContext);
                    context.setSecurityPolicy(appconfig);
                } else {
                    ApplicationSecurityConfiguration config0 =
                            (ApplicationSecurityConfiguration) _sConfig.
                            getAllTopLevelApplicationSecurityConfigurations().
                            iterator().next();
                   
                    //sContext.setPortIdentifier ("");
                    context.setPolicyContext(sContext);
                    context.setSecurityPolicy(config0);
                }
            } else {
                sContext.setOperationIdentifier(operation);
                packet.invocationProperties.put(CONTEXT_WSDL_OPERATION, operation);
                SecurityPolicy policy =
                        _sConfig.getSecurityConfiguration(sContext);
               
                context.setPolicyContext(sContext);
View Full Code Here

Examples of org.springframework.context.support.StaticApplicationContext

    @Before
    public void setUp() throws Exception {
        messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
        XMLUnit.setIgnoreWhitespace(true);
        applicationContext = new StaticApplicationContext();
        applicationContext.registerSingleton("mapping", AnnotationActionEndpointMapping.class);
      applicationContext.registerSingleton("interceptor", MyInterceptor.class);
      applicationContext.registerSingleton("endpoint", MyEndpoint.class);
      applicationContext.refresh();
        mapping = (AnnotationActionEndpointMapping) applicationContext.getBean("mapping");
View Full Code Here

Examples of org.springframework.context.support.StaticApplicationContext

*/
public class MapBasedSoapEndpointMappingTest {

    @Test
    public void testBeanNames() throws Exception {
        StaticApplicationContext context = new StaticApplicationContext();
        context.registerSingleton("endpointMapping", MyMapBasedEndpointMapping.class);
        context.registerSingleton("endpoint", Object.class);
        context.registerAlias("endpoint", "alias");
        MyMapBasedEndpointMapping mapping = new MyMapBasedEndpointMapping();
        mapping.setValidKeys(new String[]{"endpoint", "alias"});

        mapping.setRegisterBeanNames(true);
        mapping.setApplicationContext(context);
View Full Code Here

Examples of org.springframework.context.support.StaticApplicationContext

    }

    @Test
    public void testDisabledBeanNames() throws Exception {
        StaticApplicationContext context = new StaticApplicationContext();
        context.registerSingleton("endpoint", Object.class);

        MyMapBasedEndpointMapping mapping = new MyMapBasedEndpointMapping();

        mapping.setRegisterBeanNames(true);
        mapping.setApplicationContext(context);
View Full Code Here

Examples of org.springframework.context.support.StaticApplicationContext

        MyMapBasedEndpointMapping mapping = new MyMapBasedEndpointMapping();
        mapping.setValidKeys(new String[]{"endpoint1", "endpoint2"});

        mapping.setEndpointMap(endpointMap);
        mapping.setApplicationContext(new StaticApplicationContext());

        // try endpoint1
        mapping.setKey("endpoint1");
        Assert.assertNotNull("No endpoint returned", mapping.getEndpointInternal(null));
View Full Code Here

Examples of org.springframework.context.support.StaticApplicationContext

        assertEquals("Unexpected EndpointInterceptor returned", interceptor, result.getInterceptors()[0]);
    }

    @Test
    public void smartEndpointInterceptors() throws Exception {
        StaticApplicationContext applicationContext = new StaticApplicationContext();
        applicationContext.registerSingleton("smartInterceptor", MySmartEndpointInterceptor.class);

        final Object endpoint = new Object();
        EndpointInterceptor interceptor = new EndpointInterceptorAdapter();
        AbstractEndpointMapping mapping = new AbstractEndpointMapping() {
            @Override
View Full Code Here

Examples of org.springframework.context.support.StaticApplicationContext

                result.getInterceptors()[1] instanceof MySmartEndpointInterceptor);
    }

    @Test
    public void endpointBeanName() throws Exception {
        StaticApplicationContext applicationContext = new StaticApplicationContext();
        applicationContext.registerSingleton("endpoint", Object.class);

        AbstractEndpointMapping mapping = new AbstractEndpointMapping() {

            @Override
            protected Object getEndpointInternal(MessageContext message) throws Exception {
View Full Code Here

Examples of org.springframework.context.support.StaticApplicationContext

        assertNotNull("No endpoint returned", result);
    }

    @Test
    public void endpointInvalidBeanName() throws Exception {
        StaticApplicationContext applicationContext = new StaticApplicationContext();
        applicationContext.registerSingleton("endpoint", Object.class);

        AbstractEndpointMapping mapping = new AbstractEndpointMapping() {

            @Override
            protected Object getEndpointInternal(MessageContext message) throws Exception {
View Full Code Here

Examples of org.springframework.context.support.StaticApplicationContext

        assertNull("No endpoint returned", result);
    }

    @Test
    public void endpointPrototype() throws Exception {
        StaticApplicationContext applicationContext = new StaticApplicationContext();
        applicationContext.registerPrototype("endpoint", MyEndpoint.class);

        AbstractEndpointMapping mapping = new AbstractEndpointMapping() {

            @Override
            protected Object getEndpointInternal(MessageContext message) throws Exception {
View Full Code Here

Examples of org.springframework.context.support.StaticApplicationContext

    private StaticApplicationContext applicationContext;

    @Before
    public void setUp() throws Exception {
        applicationContext = new StaticApplicationContext();
        applicationContext.registerSingleton("mapping", SoapActionAnnotationMethodEndpointMapping.class);
        applicationContext.registerSingleton("endpoint", MyEndpoint.class);
        applicationContext.refresh();
        mapping = (SoapActionAnnotationMethodEndpointMapping) applicationContext.getBean("mapping");
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.