Java 8 RefAddr - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 RefAddr class.

This code example shows how to use the following methods:getContent
    RefAddr maxExhaustedTimeBeforeMarkingAsDown = resourceRef.get("maxExhaustedTimeBeforeMarkingAsDown");
    RefAddr autoDiscoverHosts = resourceRef.get("autoDiscoverHosts");
    RefAddr runAutoDiscoverAtStartup = resourceRef.get("runAutoDiscoveryAtStartup");
    RefAddr retryDownedHostDelayInSeconds = resourceRef.get("retryDownedHostDelayInSeconds");
     
    if ( hostsRefAddr == null || hostsRefAddr.getContent() == null) {
      throw new Exception("A url and port on which Cassandra is installed and listening " + 
      "on must be provided as a ResourceParams in the context.xml"); 
    }         
 
    cassandraHostConfigurator = new CassandraHostConfigurator((String)hostsRefAddr.getContent());
    if ( autoDiscoverHosts != null ) {
      cassandraHostConfigurator.setAutoDiscoverHosts(Boolean.parseBoolean((String)autoDiscoverHosts.getContent()));
      if ( runAutoDiscoverAtStartup  != null )
        cassandraHostConfigurator.setRunAutoDiscoveryAtStartup(Boolean.parseBoolean((String)autoDiscoverHosts.getContent()));
    }     
    if ( retryDownedHostDelayInSeconds != null ) {
      int retryDelay = Integer.parseInt((String)retryDownedHostDelayInSeconds.getContent());
      // disable retry if less than 1 
      if ( retryDelay < 1 )
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getContent
            Properties env = new Properties();
            env.put(Context.INITIAL_CONTEXT_FACTORY, factory);
 
            RefAddr linkRefAddr = ref.get("openejb.link");
            if (linkRefAddr != null) {
                String ejbLink = linkRefAddr.getContent().toString();
                beanObj = (new InitialContext(env)).lookup(ejbLink);
            } 
 
        } 
 
        return beanObj; 
 
    } 
 
 
} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getContent
        MemoryUserDatabase database = new MemoryUserDatabase(name.toString());
        RefAddr ra = null;
 
        ra = ref.get("pathname");
        if (ra != null) {
            database.setPathname(ra.getContent().toString());
        } 
 
        ra = ref.get("readonly");
        if (ra != null) {
            database.setReadonly(Boolean.valueOf(ra.getContent().toString()).booleanValue());
        } 
 
        // Return the configured database instance 
        database.open();
        // Don't try something we know won't work 
        if (!database.getReadonly())
            database.save();
        return (database);
 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getContent
 
   public Object getObjectInstance(final Object obj, final Name name, final Context nameCtx, final Hashtable<?, ?> env) throws ExceptionReference ref = (Reference) obj;
      RefAddr addr = ref.get("nns");
      String key = (String) addr.getContent();
      return NonSerializableFactory.getWrapperMap().get(key);
   } 
 
   public static Map<String, Object> getWrapperMap()
   { 
      return NonSerializableFactory.wrapperMap; 
   } 
 
   private static Map<String, Object> wrapperMap = Collections.synchronizedMap(new HashMap<String, Object>());
} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getContent
 
   public Object getObjectInstance(final Object obj, final Name name, final Context nameCtx, final Hashtable env) throws ExceptionReference ref = (Reference)obj;
      RefAddr addr = ref.get("nns");
      String key = (String)addr.getContent();
      return NonSerializableFactory.getWrapperMap().get(key);
   } 
 
   public static Map getWrapperMap()
   { 
      return NonSerializableFactory.wrapperMap;
   } 
 
   private static Map wrapperMap = Collections.synchronizedMap(new HashMap());
} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getContent
    protected String getProperty(final Reference ref, final String propName, final String defValue) {
        final RefAddr addr = ref.get(propName);
        if (addr == null) {
            return defValue;
        } 
        return (String) addr.getContent();
    } 
 
} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getContent
 
   public Object getObjectInstance(final Object obj, final Name name, final Context nameCtx, final Hashtable<?, ?> env) throws ExceptionReference ref = (Reference) obj;
      RefAddr addr = ref.get("nns");
      String key = (String) addr.getContent();
      return NonSerializableFactory.getWrapperMap().get(key);
   } 
 
   public static Map<String, Object> getWrapperMap()
   { 
      return NonSerializableFactory.wrapperMap; 
   } 
 
   private static Map<String, Object> wrapperMap = Collections.synchronizedMap(new HashMap<String, Object>());
} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getContent
    } 
 
    private String nullSafeRefAddrStringGet(String referenceName, Reference ref) {
        RefAddr refAddr = ref.get(referenceName);
 
        String asString = refAddr != null ? (String) refAddr.getContent() : null;
 
        return asString;
    } 
} 
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getContent
	} 
	 
	private String nullSafeRefAddrStringGet(String referenceName, Reference ref) {
		RefAddr refAddr = ref.get(referenceName);
		 
		String asString = refAddr != null ? (String)refAddr.getContent() : null;
		 
		return asString;
	} 
} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getContent
            if (ref.getClassName().equals(QpidQueueImpl.class.getName()))
            { 
                RefAddr addr = ref.get(QpidQueueImpl.class.getName());
                if (addr != null)
                { 
                    bindingURLString = (String) addr.getContent();
 
                    return new QpidQueueImpl(bindingURLString);
                } 
 
            } 
 
            if (ref.getClassName().equals(QpidTopicImpl.class.getName()))
            { 
                RefAddr addr = ref.get(QpidTopicImpl.class.getName());
 
                if (addr != null)
                { 
                    bindingURLString = (String) addr.getContent();
                    return new QpidTopicImpl(bindingURLString);
5
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Java 8 RefAddr Methods: