Package javax.naming.spi

Examples of javax.naming.spi.DirObjectFactory


        try {
            ServiceReference[] refs = callerContext.getServiceReferences(DirObjectFactory.class.getName(), null);
            if (refs != null) {
                Arrays.sort(refs, Utils.SERVICE_REFERENCE_COMPARATOR);
                for (ServiceReference ref : refs) {
                    DirObjectFactory factory = (DirObjectFactory) callerContext.getService(ref);

                    try {
                        result = factory.getObjectInstance(obj, name, nameCtx, environment, attrs);
                    } finally {
                        callerContext.ungetService(ref);
                    }

                    // if the result comes back and is not null and not the reference
View Full Code Here


        Object result = null;
        while (addresses.hasMoreElements()) {
            RefAddr address = addresses.nextElement();
            if (address instanceof StringRefAddr && "URL".equals(address.getType())) {
                String urlScheme = getUrlScheme( (String) address.getContent() );
                DirObjectFactory factory = null;
                ServiceReference ref = null;
                try {
                    ServiceReference[] services = callerContext.getServiceReferences(DirObjectFactory.class.getName(),
                            "(&(" + JNDIConstants.JNDI_URLSCHEME + "=" + urlScheme + "))");

                    if (services != null && services.length > 0) {
                        ref = services[0];
                    }
                } catch (InvalidSyntaxException e) {
                    // should not happen
                    throw new RuntimeException("Invalid filter", e);
                }

                if (ref != null) {
                    factory = (DirObjectFactory) callerContext.getService(ref);
                   
                    String value = (String) address.getContent();
                    try {
                        result = factory.getObjectInstance(value, name, nameCtx, environment, attrs);
                    } finally {
                        callerContext.ungetService(ref);
                    }

                    // if the result comes back and is not null and not the reference
View Full Code Here

        }

        Object result = null;
       
        if (serviceReference != null) {
            DirObjectFactory factory = (DirObjectFactory) defaultContext.getService(serviceReference);
            try {
                result = factory.getObjectInstance(reference, name, nameCtx, environment, attrs);
            } finally {
                defaultContext.ungetService(serviceReference);
            }
        }
View Full Code Here

        try {
            ServiceReference[] refs = callerContext.getServiceReferences(DirObjectFactory.class.getName(), null);
            if (refs != null) {
                Arrays.sort(refs, Utils.SERVICE_REFERENCE_COMPARATOR);
                for (ServiceReference ref : refs) {
                    DirObjectFactory factory = (DirObjectFactory) callerContext.getService(ref);

                    try {
                        result = factory.getObjectInstance(obj, name, nameCtx, environment, attrs);
                    } finally {
                        callerContext.ungetService(ref);
                    }

                    // if the result comes back and is not null and not the reference
View Full Code Here

        }

        Object result = null;
       
        if (serviceReference != null) {
            DirObjectFactory factory = (DirObjectFactory) defaultContext.getService(serviceReference);
            try {
                result = factory.getObjectInstance(reference, name, nameCtx, environment, attrs);
            } finally {
                defaultContext.ungetService(serviceReference);
            }
        }
View Full Code Here

        Object result = null;
        ServiceReference[] refs = Utils.getReferencesPrivileged(callerContext, DirObjectFactory.class);
        if (refs != null) {
          Arrays.sort(refs, Utils.SERVICE_REFERENCE_COMPARATOR);
          for (ServiceReference ref : refs) {
            DirObjectFactory factory = (DirObjectFactory) Utils.getServicePrivileged(callerContext, ref);

            try {
              result = factory.getObjectInstance(obj, name, nameCtx, environment, attrs);
            } finally {
              callerContext.ungetService(ref);
            }

            // if the result comes back and is not null and not the reference
View Full Code Here

TOP

Related Classes of javax.naming.spi.DirObjectFactory

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.