Package org.apache.neethi.builders

Examples of org.apache.neethi.builders.AssertionBuilder


                if (currLine.length() > 0) {
                    try {
                        Class<?> cls = bundle.loadClass(currLine);
                        Object instance = cls.newInstance();
                        if (instance instanceof AssertionBuilder) {
                            AssertionBuilder assertionBuilder = (AssertionBuilder) instance;
                            for (QName supportedQName : assertionBuilder.getKnownElements()) {
                                PolicyEngine.registerBuilder(supportedQName, assertionBuilder);
                            }
                        } else {
                            logger.warn(currLine + " in the META-INF/services/ org.apache.neethi.builders.AssertionBuilder from bundle " + bundle.getSymbolicName()
                                    + " is not of type AssertionBuilder, it will be ignored");
View Full Code Here


     *      an Assertion.
     * @return an Assertion that is built using the specified element.
     */
    public Assertion build(OMElement element) {

        AssertionBuilder builder;

        QName qname = element.getQName();
        builder = (AssertionBuilder) registeredBuilders.get(qname);

        if (builder != null) {
            return builder.build(element, this);
        }

        /*
         *  if we can't locate an appropriate AssertionBuilder, we always
         *  use the XMLPrimitiveAssertionBuilder
         */
        builder = (AssertionBuilder) registeredBuilders
                .get(XML_ASSERTION_BUILDER);
        return builder.build(element, this);
    }
View Full Code Here

     *      an Assertion.
     * @return an Assertion that is built using the specified element.
     */
    public Assertion build(OMElement element) {

        AssertionBuilder builder;

        QName qname = element.getQName();
        builder = (AssertionBuilder) registeredBuilders.get(qname);

        if (builder != null) {
            return builder.build(element, this);
        }

        /*
         *  if we can't locate an appropriate AssertionBuilder, we always
         *  use the XMLPrimitiveAssertionBuilder
         */
        builder = (AssertionBuilder) registeredBuilders
                .get(XML_ASSERTION_BUILDER);
        return builder.build(element, this);
    }
View Full Code Here

    @Before
    public void setUp() {
        builder = new PolicyBuilderImpl();
        AssertionBuilderRegistry abr = new AssertionBuilderRegistryImpl();
        builder.setAssertionBuilderRegistry(abr);
        AssertionBuilder ab = new PrimitiveAssertionBuilder();
        abr.registerBuilder(new QName("http://sample.org/Assertions", "A"), ab);
        abr.registerBuilder(new QName("http://sample.org/Assertions", "B"), ab);
        abr.registerBuilder(new QName("http://sample.org/Assertions", "C"), ab);
    }
View Full Code Here

        try {
            bus = new SpringBusFactory().createBus("/org/apache/cxf/ws/policy/policy-bus.xml", false);

            AssertionBuilderRegistry abr = bus.getExtension(AssertionBuilderRegistry.class);
            assertNotNull(abr);
            AssertionBuilder ab = abr.getBuilder(KNOWN);
            assertNotNull(ab);
            ab = abr.getBuilder(UNKNOWN);
            assertNull(ab);

            PolicyInterceptorProviderRegistry pipr = bus
View Full Code Here

        Bundle bundle = bundleContext.getBundle();

        try {
            for (String buildeName : builders) {
                Class aClass = bundle.loadClass(buildeName.trim());
                AssertionBuilder builder = (AssertionBuilder) aClass.newInstance();
                QName[] knownElements = builder.getKnownElements();
                for (QName knownElement : knownElements) {
                    AssertionBuilderFactory.registerBuilder(knownElement, builder);
                }
            }
View Full Code Here

        //Alternative to service provider
        String[] builders = new String[]{"org.apache.axis2.policy.builders.MTOM10AssertionBuilder"};
        try {
            for (String buildeName : builders) {
                Class aClass = context.getBundle().loadClass(buildeName.trim());
                AssertionBuilder builder = (AssertionBuilder) aClass.newInstance();
                QName[] knownElements = builder.getKnownElements();
                for (QName knownElement : knownElements) {
                    AssertionBuilderFactory.registerBuilder(knownElement, builder);
                }
            }
        } catch (ClassNotFoundException e) {
View Full Code Here

            System.setProperty("java.security.auth.login.config", carbonHome + File.separator + "repository"+ File.separator + "conf" + File.separator + "jaas.conf");
           
            //Registering rampart policy builders
            for (String buildeName : builders) {
                Class aClass = bundle.loadClass(buildeName.trim());
                AssertionBuilder builder = (AssertionBuilder) aClass.newInstance();
                QName[] knownElements = builder.getKnownElements();
                for (QName knownElement : knownElements) {
                    AssertionBuilderFactory.registerBuilder(knownElement, builder);
                }
            }
    }
View Full Code Here

     *            Assertion.
     * @return an Assertion that is built using the specified element.
     */
    public Assertion build(Object element) {
        loadDynamic();
        AssertionBuilder builder;

        QName qname = converters.findQName(element);
        builder = registeredBuilders.get(qname);
        if (builder == null) {
            builder = handleNoRegisteredBuilder(qname);
View Full Code Here

     *      an Assertion.
     * @return an Assertion that is built using the specified element.
     */
    public Assertion build(OMElement element) {

        AssertionBuilder builder;

        QName qname = element.getQName();
        builder = (AssertionBuilder) registeredBuilders.get(qname);

        if (builder != null) {
            return builder.build(element, this);
        }

        /*
         *  if we can't locate an appropriate AssertionBuilder, we always
         *  use the XMLPrimitiveAssertionBuilder
         */
        builder = (AssertionBuilder) registeredBuilders
                .get(XML_ASSERTION_BUILDER);
        return builder.build(element, this);
    }
View Full Code Here

TOP

Related Classes of org.apache.neethi.builders.AssertionBuilder

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.