Looks up the object from the cache

@param oid  The Identity to look up the object for
@return     The object if found, otherwise null
777242
public Object lookup(Identity oid)
    {
        Object ret = null;
        if (oid != null)
        {
            ObjectCache cache = getCache(oid, null, METHOD_LOOKUP);
            if (cache != null)
            {
                ret = cache.lookup(oid);
            }
        }
        return ret;
    }
1244102
public void cache(Identity oid, Object obj)
    {
        doInternalCache(oid, obj, ObjectCacheInternal.TYPE_UNKNOWN);
    }
28837
@Nullable
    private AuthorizationInfo getAuthorizationInfoById(String id) {
        AuthorizationInfo authorizationInfo;

        // Search the cache first
        Cache<String, AuthorizationInfo> idAuthorizationCache = getAvailableIdAuthorizationCache();

        if (idAuthorizationCache != null) {
            authorizationInfo = idAuthorizationCache.get(id);

            if (authorizationInfo != null) {
                // Check whether it is the stand-in "null" cached value
                if (authorizationInfo != _nullAuthorizationInfo) {
                    _log.debug("Authorization info found cached for id {}", id);
                    return authorizationInfo;
                } else {
                    _log.debug("Authorization info previously cached as not found for id {}", id);
                    return null;
                }
            }
        }

        authorizationInfo = getUncachedAuthorizationInfoById(id);
        cacheAuthorizationInfoById(id, authorizationInfo);
        return authorizationInfo;
    }
867309
public T get(Object key) {
        SoftReference<T> ref = cache.get(key);
        T ob;
        
        if( ref == null ) {
            return null;
        }
        ob = ref.get();
        if( ob == null ) {
            release(key);
        }
        if( ob instanceof CachedItem ) {
            if( !((CachedItem)ob).isValidForCache() ) {
                release(key);
                return null;
            }
        }
        return ob;
    }
690668
public E findById(ID id) {
        LOG.trace("Finding " + entityClass.getSimpleName() + " with ID " + id);
        return (E) getSession().get(entityClass, id);
    }
338812
public void remove(Identity oid)
    {
        if (oid == null) return;

        ObjectCache cache = getCache(oid, null, METHOD_REMOVE);
        if (cache != null)
        {
            cache.remove(oid);
        }
    }
51821
@Beta
    public MSICredentials withObjectId(String objectId) {
        this.objectId = objectId;
        this.clientId = null;
        this.identityId = null;
        return this;
    }
38497
@Help(help = "Find the object of type {#} through the id")
  public T findById(final String id) throws SDKException {
    return (T) requestGet(id, clazz);
  }
875373
static ObjectIdentifier intern(ObjectIdentifier oid) {
        ObjectIdentifier interned = internedOIDs.get(oid);
        if (interned != null) {
            return interned;
        }
        internedOIDs.put(oid, oid);
        return oid;
    }
331586
public static IdGenerator getInstance(long nodeId) {
        IdGenerator idGen = cache.get(nodeId);
        if (idGen == null) {
            idGen = new IdGenerator(nodeId);
            idGen.init();
            IdGenerator existing = cache.putIfAbsent(nodeId, idGen);
            idGen = existing != null ? existing : idGen;
        }
        return idGen;
    }
1232086
public InetSocketAddress remoteLookup(final Identifier id) throws Exception {
    // the lookup is not thread-safe, because concurrent replies may
    // be read by the wrong thread.
    // TODO: better fix uses a map of id's after REEF-198
    synchronized (this) {

      LOG.log(Level.INFO, "Looking up {0} on NameServer {1}", new Object[]{id, serverSocketAddr});

      final List<Identifier> ids = Arrays.asList(id);
      final Link<NamingMessage> link = transport.open(serverSocketAddr, codec,
          new LoggingLinkListener<NamingMessage>());
      link.write(new NamingLookupRequest(ids));

      final NamingLookupResponse resp;
      for (;;) {
        try {
          resp = replyQueue.poll(timeout, TimeUnit.MILLISECONDS);
          break;
        } catch (final InterruptedException e) {
          LOG.log(Level.INFO, "Lookup interrupted", e);
          throw new NamingException(e);
        }
      }

      final List<NameAssignment> list = resp == null ? Collections.<NameAssignment>emptyList()
          : resp.getNameAssignments();
      if (list.isEmpty()) {
        throw new NamingException("Cannot find " + id + " from the name server");
      } else {
        return list.get(0).getAddress();
      }
    }
  }
735148
@SuppressWarnings({"TypeParameterUnusedInFormals", "unchecked"})
  private <T> T fetch(final String id) {
    checkNotNull(id);
    checkArgument(!id.isEmpty());
    final T ret = (T) idMap.get(id);
    if (ret == null) {
      throw new EREException(String.format("Lookup failed for id %s.", id));
    }
    return ret;
  }
1197425
public Service getServiceObjectFromId(String id) {
        log.fine("Return service object for " + id);
        Service service = null;
        for (Service s : services.getServices()) {
            if (id.equals(s.getId())) {
                return s;
            }
        }
        return service;
    }
883758
public C get(String id){
		C container = this.containerMap.get(id);

		if(container != null && (container.getState()).equals(State.REMOVED)){
			return null;
		}

		return container;
	}
1192312
public ObjectEnvelope get(Identity oid, Object pKey, boolean isNew)
    {
        ObjectEnvelope result = getByIdentity(oid);
        if(result == null)
        {
            result = new ObjectEnvelope(this, oid, pKey, isNew);
            mhtObjectEnvelopes.put(oid, result);
            mvOrderOfIds.add(oid);
            if(log.isDebugEnabled())
                log.debug("register: " + result);
        }
        return result;
    }
19972
@SuppressWarnings("unchecked")
    protected <T> T lookup(Class<T> entityClass, Object id)
    {
        String key = cacheKey(entityClass, id);
        LOG.debug("Reading from L1 >> " + key);
        T o = (T) sessionCache.get(key);

        // go to second-level cache
        if (o == null)
        {
            LOG.debug("Reading from L2 >> " + key);
            Cache c = (Cache) getL2Cache();
            if (c != null)
            {
                o = (T) c.get(key);
                if (o != null)
                {
                    LOG.debug("Found item in second level cache!");
                }
            }
        }
        return o;
    }
863787
public Object find(Class clazz, Object identifier) {
        try {
            return persistenceManager.findById(clazz, identifier);
        } catch (InitializationException ignore){}
        catch (Exception e) {
            e.printStackTrace();
        }

        return null;
    }