if (getDefaultWorkspaceName() != null) {
ref.add(new StringRefAddr(DEFAULT_WORKSPACE_NAME_ATTR, getDefaultWorkspaceName()));
}
if (getDefaultCachePolicy() != null) {
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);
}
}
ref.add(new StringRefAddr(RETRY_LIMIT_ATTR, Integer.toString(getRetryLimit())));
return ref;
}