Examples of BinaryRefAddr


Examples of javax.naming.BinaryRefAddr

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ObjectOutputStream oas = new ObjectOutputStream(baos);
        oas.writeObject(dataSourceDescription);
        oas.flush();
        byte[] content = baos.toByteArray();
        RefAddr addr = new BinaryRefAddr(DataSourceDescription.class.getName(), content);
        return new Reference(DataSourceService.class.getName(), addr, DataSourceGBeanObjectFactory.class.getName(), null);
    }
View Full Code Here

Examples of javax.naming.BinaryRefAddr

            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            CachePolicy policy = getDefaultCachePolicy();
            try {
                ObjectOutputStream oos = new ObjectOutputStream(baos);
                oos.writeObject(policy);
                ref.add(new BinaryRefAddr(DEFAULT_CACHE_POLICY_ATTR, baos.toByteArray()));
            } catch (IOException e) {
                I18n msg = GraphI18n.errorSerializingInMemoryCachePolicyInSource;
                throw new RepositorySourceException(getName(), msg.text(policy.getClass().getName(), getName()), e);
            }
        }
View Full Code Here

Examples of javax.naming.BinaryRefAddr

      throw namingException;
    }

    return new Reference(
        Ejb3Configuration.class.getName(),
        new BinaryRefAddr("object", serialized ),
        Ejb3ConfigurationObjectFactory.class.getName(),
        null
    );
  }
View Full Code Here

Examples of javax.naming.BinaryRefAddr

    Reference reference = new Reference(this.getClass().getName(), CommonDataSourceFactory.class.getName(), null);
    reference.add(new StringRefAddr(CommonDataSourceFactory.CLUSTER, this.cluster));
    DatabaseClusterConfigurationFactory<Z, D> factory = this.getConfigurationFactory();
    if (factory != null)
    {
      reference.add(new BinaryRefAddr(CommonDataSourceFactory.CONFIG, Objects.serialize(factory)));
    }
    else
    {
      reference.add(new StringRefAddr(CommonDataSourceFactory.CONFIG, this.config));
    }
View Full Code Here

Examples of javax.naming.BinaryRefAddr

        byte[] serJndiEnv = null;
        // BinaryRefAddr does not allow null byte[].
        if (jndiEnvironment != null)
        {
            serJndiEnv = SerializationUtils.serialize(jndiEnvironment);
            ref.add(new BinaryRefAddr("jndiEnvironment", serJndiEnv));
        }

        byte[] serPUMC = null;
        // BinaryRefAddr does not allow null byte[].
        if (getPerUserMaxConnections() != null)
        {
            serPUMC = SerializationUtils.serialize(getPerUserMaxConnections());
            ref.add(new BinaryRefAddr("perUserMaxConnections", serPUMC));
        }

        return ref;
    }
View Full Code Here

Examples of javax.naming.BinaryRefAddr

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ObjectOutputStream oas = new ObjectOutputStream(baos);
        oas.writeObject(dataSourceDescription);
        oas.flush();
        byte[] content = baos.toByteArray();
        RefAddr addr = new BinaryRefAddr(DataSourceDescription.class.getName(), content);
        return new Reference(DataSourceService.class.getName(), addr, DataSourceGBeanObjectFactory.class.getName(), null);
    }
View Full Code Here

Examples of javax.naming.BinaryRefAddr

  }

  public void testConstructor_ByRefAddr() {
    String className = "java.util.Hashtable";
    String type = "Binary";
    RefAddr refAddr = new BinaryRefAddr(type, buffer);
    Reference reference = new Reference(className, refAddr);

    assertEquals(className, reference.getClassName());
    assertEquals(refAddr, reference.get(0));
    assertNull(reference.getFactoryClassName());
View Full Code Here

Examples of javax.naming.BinaryRefAddr

    String className = "java.util.Hashtable";
    String factoryName = "factory name";
    String factoryLocation = "file:///home/";

    String type = "Binary";
    RefAddr refAddr = new BinaryRefAddr(type, buffer);

    Reference reference = new Reference(className, refAddr, factoryName,
        factoryLocation);

    assertEquals(className, reference.getClassName());
View Full Code Here

Examples of javax.naming.BinaryRefAddr

    assertEquals(1, reference.size());
  }

  public void testAdd_Simple() {
    String type = "Binary";
    BinaryRefAddr refAddr0 = new BinaryRefAddr(type, buffer);
    byte[] buffer1 = { 1, 2, 3, 4 };
    BinaryRefAddr refAddr1 = new BinaryRefAddr(type, buffer1);
    ref.add(refAddr0);
    ref.add(refAddr1);

    assertEquals(2, ref.size());
    assertEquals(refAddr0, ref.get(0));
View Full Code Here

Examples of javax.naming.BinaryRefAddr

    assertNull(ref.get(0));
  }

  public void testAdd_ByIndex() {
    String type = "Binary";
    BinaryRefAddr refAddr0 = new BinaryRefAddr(type, buffer);
    byte[] buffer1 = { 1, 2, 3, 4 };
    BinaryRefAddr refAddr1 = new BinaryRefAddr(type, buffer1);
    ref.add(0, refAddr0);
    ref.add(1, refAddr1);

    assertEquals(2, ref.size());
    assertEquals(refAddr0, ref.get(0));
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.