protected Reference(WingContext context, Object object)
throws WingException
{
super(context);
ObjectManager objectManager = context.getObjectManager();
if (objectManager == null)
throw new WingException(
"Unable to reference object because no object manager has been defined.");
if (!objectManager.manageObject(object))
throw new WingException(
"The available object manager is unable to manage the give object.");
this.url = objectManager.getObjectURL(object);
this.repository = objectManager.getRepositoryIdentifier(object);
this.type = objectManager.getObjectType(object);
}