use of javax.naming.BinaryRefAddr in project jaybird by FirebirdSQL.
the class FBAbstractCommonDataSource method updateReference.
/**
* Updates the supplied reference with RefAddr properties relevant to this class.
*
* @param ref Reference to update
* @param instance Instance of this class to obtain values
*/
protected static void updateReference(Reference ref, FBAbstractCommonDataSource instance) {
synchronized (instance.lock) {
ref.add(new StringRefAddr(REF_DESCRIPTION, instance.getDescription()));
ref.add(new StringRefAddr(REF_SERVER_NAME, instance.getServerName()));
if (instance.getPortNumber() != 0) {
ref.add(new StringRefAddr(REF_PORT_NUMBER, Integer.toString(instance.getPortNumber())));
}
ref.add(new StringRefAddr(REF_DATABASE_NAME, instance.getDatabaseName()));
byte[] data = DataSourceFactory.serialize(instance.connectionProperties);
ref.add(new BinaryRefAddr(REF_PROPERTIES, data));
}
}
Aggregations