Class RmiRequestProcessorImpl

java.lang.Object
org.rribbit.processing.RmiRequestProcessorImpl
All Implemented Interfaces:
Remote, RmiRequestProcessor

public class RmiRequestProcessorImpl extends Object implements RmiRequestProcessor
This RequestProcessor processes requests that it receives from an RmiRequestDispatcher and returns the result via RMI. In order to use this RequestProcessor, all parameters and return values must implement Serializable. Note that an RmiRequestProcessorImpl is not actually an RequestProcessor, because Java RMI does not allow non-remote methods in a remote interface. This is not a problem though, since an RmiRequestProcessorImpl receives its requests via RMI and not via a Java interface.

Users of this class must call shutdown() after use, to clean up the RMI Registry.

Author:
G.J. Schouten
  • Field Details

  • Constructor Details

    • RmiRequestProcessorImpl

      public RmiRequestProcessorImpl(int portnumber)
      Sets up a Registry on the specified portnumber that does NOT use SSL.

      Whenever you use this constructor, be sure to set the ListenerObjectRetriever AND the ListenerObjectExecutor with the setters provided by this class. If you don't, runtime NullPointerExceptions will occur.

      Parameters:
      portnumber - The portnumber to use
    • RmiRequestProcessorImpl

      public RmiRequestProcessorImpl(int portnumber, ListenerObjectRetriever listenerObjectRetriever, ListenerObjectExecutor listenerObjectExecutor)
      Sets up a Registry on the specified portnumber that does NOT use SSL.

      This constructor is recommended, since it forces you to specify the ListenerObjectRetriever and ListenerObjectExecutor. Passing a null value for either of these will result in a runtime NullPointerException whenever the RmiRequestProcessorImpl is used.

      Parameters:
      portnumber - The portnumber to use
      listenerObjectRetriever -
      listenerObjectExecutor -
    • RmiRequestProcessorImpl

      public RmiRequestProcessorImpl(int portnumber, String keystoreLocation, String keystorePassword, String truststoreLocation, String truststorePassword)
      Sets up a Registry on the specified portnumber that uses SSL with the supplied parameters. The following system properties will be set:
      • javax.net.ssl.keyStore
      • javax.net.ssl.keyStorePassword
      • javax.net.ssl.trustStore
      Whenever you use this constructor, be sure to set the ListenerObjectRetriever AND the ListenerObjectExecutor with the setters provided by this class. If you don't, runtime NullPointerExceptions will occur.
      Parameters:
      portnumber - The portnumber to use
      keystoreLocation - The filepath that contains the SSL keystore, without file://
      keystorePassword - The password of the SSL keystore
      truststoreLocation - The filepath that contains the SSL truststore, without file://
      truststorePassword - The password of the SSL truststore
    • RmiRequestProcessorImpl

      public RmiRequestProcessorImpl(int portnumber, String keystoreLocation, String keystorePassword, String truststoreLocation, String truststorePassword, ListenerObjectRetriever listenerObjectRetriever, ListenerObjectExecutor listenerObjectExecutor)
      Sets up a Registry on the specified portnumber that uses SSL with the supplied parameters. The following system properties will be set:
      • javax.net.ssl.keyStore
      • javax.net.ssl.keyStorePassword
      • javax.net.ssl.trustStore
      This constructor is recommended, since it forces you to specify the ListenerObjectRetriever and ListenerObjectExecutor. Passing a null value for either of these will result in a runtime NullPointerException whenever the RmiRequestProcessorImpl is used.
      Parameters:
      portnumber - The portnumber to use
      keystoreLocation - The filepath that contains the SSL keystore, without file://
      keystorePassword - The password of the SSL keystore
      truststoreLocation - The filepath that contains the SSL truststore, without file://
      truststorePassword - The password of the SSL truststore
      listenerObjectRetriever -
      listenerObjectExecutor -
  • Method Details