1 15 package org.apache.tapestry.services.impl; 16 17 import org.apache.hivemind.Location; 18 import org.apache.hivemind.internal.Module; 19 import org.apache.hivemind.schema.Translator; 20 21 30 public class DeferredObjectImpl implements DeferredObject 31 { 32 private final Module _module; 33 34 private final Translator _objectTranslator; 35 36 private final String _objectReference; 37 38 private final Location _location; 39 40 private Object _object; 41 42 public DeferredObjectImpl(final Translator objectTranslator, final Module module, 43 final String objectReference, final Location location) 44 { 45 _objectTranslator = objectTranslator; 46 _module = module; 47 _objectReference = objectReference; 48 _location = location; 49 } 50 51 public synchronized Object getObject() 52 { 53 if (_object == null) 54 _object = _objectTranslator.translate( 55 _module, 56 Object .class, 57 _objectReference, 58 _location); 59 60 return _object; 61 } 62 63 public Location getLocation() 64 { 65 return _location; 66 } 67 } | Popular Tags |