Interface ClientAdapter

    • Method Detail

      • makeLocalProxy

        Optional<Object> makeLocalProxy​(String jndiName,
                                        Context remoteContext)
                                 throws NamingException
        Construct local (client-side) proxy if name matches. The method is expected to examing jndiName being looked up and if it matches adapter's adaptation, construct a local proxy and return it wrapped in an Optional<>. Otherwise it must return Optional.empty().

        Generated proxy intends calling other remote resources, it may use provided remoteContext, which refers to instance of RemoteEJBContext. Note that provided instance still applies this ClientAdapter, so it is not possible to wrap a remote object with behavior.

        Parameters:
        jndiName - jndi name requested for lookup
        remoteContext - naming context for remote EJB invocation
        Returns:
        Optional.of(proxy) if adapter provides a proxy for given name, Optional.empty() otherwise
        Throws:
        NamingException - if downstream lookup fails, or other validation doesn't pass