Interface ServiceProxyFactory

All Known Implementing Classes:
BurlapProxyFactory, HessianProxyFactory

public interface ServiceProxyFactory
Factory for creating client stubs. The returned stub will call the remote object for all methods.
 URL url = new URL("http://localhost:8080/ejb/hello");
 HelloHome hello = (HelloHome) factory.create(HelloHome.class, url);
 
After creation, the stub can be like a regular Java class. Because it makes remote calls, it can throw more exceptions than a Java class. In particular, it may throw protocol exceptions.
  • Method Summary

    Modifier and Type
    Method
    Description
    create(Class api, String url)
    Creates a new proxy with the specified URL.
  • Method Details

    • create

      Object create(Class api, String url) throws MalformedURLException
      Creates a new proxy with the specified URL. The returned object is a proxy with the interface specified by api.
       String url = "http://localhost:8080/ejb/hello");
       HelloHome hello = (HelloHome) factory.create(HelloHome.class, url);
       
      Parameters:
      api - the interface the proxy class needs to implement
      url - the URL where the client object is located.
      Returns:
      a proxy to the object with the specified interface.
      Throws:
      MalformedURLException