コード例 #1
0
 @Override
 protected Object retrieve(Context context) {
   Collection<Reference<?>> references = context.getReferences(getTargetInterfaceName(), filter);
   if (references == null || references.isEmpty()) {
     return null;
   }
   if (references.size() > 1) {
     throw new IllegalStateException(
         this + " mapped to " + references.size() + " instances: " + references);
   }
   reference = references.iterator().next();
   return reference.getService();
 }
コード例 #2
0
 @Override
 protected void wasDisposed() {
   reference.unget();
 }