Examples of RefAddr


Examples of javax.naming.RefAddr

    private static void setBeanProperties(Object ds, Reference ref)
            throws Exception {

        for (Enumeration e = ref.getAll(); e.hasMoreElements();) {

            RefAddr attribute = (RefAddr) e.nextElement();

            String propertyName = attribute.getType();

            String value = (String) attribute.getContent();

            String methodName = "set"
                    + propertyName.substring(0, 1).toUpperCase(
                            java.util.Locale.ENGLISH)
                    + propertyName.substring(1);
View Full Code Here

Examples of javax.naming.RefAddr

        try {
            Reference ref = cds.getReference();
           
            for (Enumeration e = ref.getAll(); e.hasMoreElements();) {

                RefAddr attribute = (RefAddr) e.nextElement();

                String propertyKey = attribute.getType();
                String value = (String) attribute.getContent();
               
                // Don't display the password or even its length
                if (Attribute.PASSWORD_ATTR.equals(propertyKey)) {
                    value = "********";
                }
View Full Code Here

Examples of javax.naming.RefAddr

        throws NamingException {
        Object result = super.getObjectInstance(obj, name, nameCtx, environment);
        // Can we process this request?
        if (result!=null) {
            Reference ref = (Reference) obj;
            RefAddr userAttr = ref.get("username");
            RefAddr passAttr = ref.get("password");
            if (userAttr.getContent()!=null && passAttr.getContent()!=null) {
                result = wrapDataSource(result,userAttr.getContent().toString(), passAttr.getContent().toString());
            }
        }
        return result;
    }
View Full Code Here

Examples of javax.naming.RefAddr

                                                    Context nameCtx,
                                                    Hashtable<?, ?> environment)
        throws Exception {      
        Object result = null;
        while (addresses.hasMoreElements()) {
            RefAddr address = addresses.nextElement();
            if (address instanceof StringRefAddr && "URL".equals(address.getType())) {
                String urlScheme = getUrlScheme( (String) address.getContent() );
               
                ServicePair<ObjectFactory> factoryService = ContextHelper.getURLObjectFactory(callerContext, urlScheme, environment);
               
                if (factoryService != null) {
                    ObjectFactory factory = factoryService.get();
                   
                    String value = (String) address.getContent();
                    try {
                        result = factory.getObjectInstance(value, name, nameCtx, environment);
                    } finally {
                        factoryService.unget();
                    }
View Full Code Here

Examples of javax.naming.RefAddr

   
    URL url = null;
    if (obj != null && obj instanceof Reference) {
      Reference reference = (Reference)obj;
      if ("java.net.URL".equals(reference.getClassName())) {
        RefAddr refAddr = reference.get("url");
        if (refAddr != null) {
          String urlStr = (String) refAddr.getContent();
          if (urlStr != null && urlStr.length() > 0) {
            url = createUrl(urlStr);
          }
        }       
      }
View Full Code Here

Examples of javax.naming.RefAddr

        if (obj instanceof Reference) {
            Reference reference = (Reference) obj;

            Enumeration<RefAddr> addrs = reference.getAll();
            while (addrs.hasMoreElements()) {
                RefAddr refAddr = addrs.nextElement();

                if ("togglzConfig".equals(refAddr.getType())) {

                    String classname = refAddr.getContent().toString().trim();
                    return (TogglzConfig) createInstance(classname);

                }

            }
View Full Code Here

Examples of javax.naming.RefAddr

        if (obj instanceof Reference) {
            Map<String, String> values = new HashMap<String, String>();
            Reference ref = (Reference)obj;
            Enumeration<?> en = ref.getAll();
            while (en.hasMoreElements()) {
                RefAddr subref = (RefAddr)en.nextElement();
                if (subref instanceof StringRefAddr) {
                    String key = subref.getType();
                    Object value = subref.getContent();
                    if (value != null) values.put(key, value.toString());
                }
            }
            String repositoryName = values.get(FederatedRepositorySource.REPOSITORY_NAME);
            String sourceName = values.get(FederatedRepositorySource.SOURCE_NAME);
View Full Code Here

Examples of javax.naming.RefAddr

        if (obj instanceof Reference) {
            Map<String, String> values = new HashMap<String, String>();
            Reference ref = (Reference)obj;
            Enumeration<?> en = ref.getAll();
            while (en.hasMoreElements()) {
                RefAddr subref = (RefAddr)en.nextElement();
                if (subref instanceof StringRefAddr) {
                    String key = subref.getType();
                    Object value = subref.getContent();
                    if (value != null) values.put(key, value.toString());
                }
            }
            String sourceName = values.get(SOURCE_NAME);
            String repositoryRootURL = values.get(SVN_REPOSITORY_ROOT_URL);
View Full Code Here

Examples of javax.naming.RefAddr

        if (obj instanceof Reference) {
            Map<String, Object> values = new HashMap<String, Object>();
            Reference ref = (Reference)obj;
            Enumeration<?> en = ref.getAll();
            while (en.hasMoreElements()) {
                RefAddr subref = (RefAddr)en.nextElement();
                if (subref instanceof StringRefAddr) {
                    String key = subref.getType();
                    Object value = subref.getContent();
                    if (value != null) values.put(key, value.toString());
                } else if (subref instanceof BinaryRefAddr) {
                    String key = subref.getType();
                    Object value = subref.getContent();
                    if (value instanceof byte[]) {
                        // Deserialize ...
                        ByteArrayInputStream bais = new ByteArrayInputStream((byte[])value);
                        ObjectInputStream ois = new ObjectInputStream(bais);
                        value = ois.readObject();
View Full Code Here

Examples of javax.naming.RefAddr

        if (resolvedObj instanceof javax.naming.Context) {
            // obj is a context and child is not found
            // try getting its nns dynamically by constructing
            // a Reference containing obj.
            RefAddr addr = new RefAddr("nns") {
                public java.lang.Object getContent() {
                    return resolvedObj;
                }

                private static final long serialVersionUID =
                        669984699392133792L;
            };
            Reference ref = new Reference("java.lang.Object", addr);

            // Resolved name has trailing slash to indicate nns
            CompositeName cname = new CompositeName();
            cname.add(""); // add trailing slash

            cpe.setResolvedObj(ref);
            cpe.setAltName(cname);
            cpe.setAltNameCtx((javax.naming.Context) resolvedObj);

            return cpe;
        } else {
            // Not a context, use object factory to transform object.

            Name cname = org.jboss.as.jacorb.naming.jndi.CNNameParser.cosNameToName(resolvedName);
            java.lang.Object resolvedObj2;
            try {
                resolvedObj2 = NamingManager.getObjectInstance(resolvedObj,
                        cname, ctx, ctx._env);
            } catch (NamingException ge) {
                throw ge;
            } catch (Exception ge) {
                NamingException ne = JacORBMessages.MESSAGES.errorGeneratingObjectViaFactory();
                ne.setRootCause(ge);
                throw ne;
            }

            // If a context, continue operation with context
            if (resolvedObj2 instanceof javax.naming.Context) {
                cpe.setResolvedObj(resolvedObj2);
            } else {
                // Add trailing slash
                cname.add("");
                cpe.setAltName(cname);

                // Create nns reference
                final java.lang.Object rf2 = resolvedObj2;
                RefAddr addr = new RefAddr("nns") {
                    public java.lang.Object getContent() {
                        return rf2;
                    }

                    private static final long serialVersionUID =
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.