/[classpath]/classpath/gnu/CORBA/Functional_ORB.java
ViewVC logotype

Diff of /classpath/gnu/CORBA/Functional_ORB.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.20 by audriusa, Wed Oct 5 16:25:42 2005 UTC revision 1.21 by audriusa, Sun Oct 16 22:39:05 2005 UTC
# Line 103  public class Functional_ORB extends Rest Line 103  public class Functional_ORB extends Rest
103     * may listen on multiple ports and process the requests in separate threads.     * may listen on multiple ports and process the requests in separate threads.
104     * Normally the server takes one port per object being served.     * Normally the server takes one port per object being served.
105     */     */
106    class portServer extends Thread    protected class portServer
107        extends Thread
108    {    {
109      /**      /**
110       * The number of the currently running parallel threads.       * The number of the currently running parallel threads.
111       */       */
112      int running_threads;      int running_threads;
113    
114      /**      /**
115       * The port on that this portServer is listening for requests.       * The port on that this portServer is listening for requests.
# Line 132  public class Functional_ORB extends Rest Line 133  public class Functional_ORB extends Rest
133      {      {
134        s_port = _port;        s_port = _port;
135        setDaemon(true);        setDaemon(true);
     }  
   
     /**  
      * Enter the serving loop (get request/process it). All portServer normally  
      * terminate thy threads when the Functional_ORB.running is set to false.  
      */  
     public void run()  
     {  
136        try        try
137          {          {
138            service = new ServerSocket(s_port);            service = new ServerSocket(s_port);
139          }          }
140        catch (IOException ex)        catch (IOException ex)
141          {          {
142            BAD_OPERATION bad =            BAD_OPERATION bad = new BAD_OPERATION(
143              new BAD_OPERATION("Unable to open the server socket at "+s_port);              "Unable to open the server socket at " + s_port);
144            bad.minor = Minor.Socket;            bad.minor = Minor.Socket;
145            bad.initCause(ex);            bad.initCause(ex);
146            throw bad;            throw bad;
147          }          }
148        }
149    
150        /**
151         * Enter the serving loop (get request/process it). All portServer normally
152         * terminate thy threads when the Functional_ORB.running is set to false.
153         */
154        public void run()
155        {
156        while (running)        while (running)
157          {          {
158            try            try
# Line 183  public class Functional_ORB extends Rest Line 183  public class Functional_ORB extends Rest
183    
184      /**      /**
185       * Perform a single serving step.       * Perform a single serving step.
186       *       *
187       * @throws java.lang.Exception       * @throws java.lang.Exception
188       */       */
189      void tick() throws Exception      void tick()
190          throws Exception
191      {      {
192        serve(this, service);        serve(this, service);
193      }      }
# Line 222  public class Functional_ORB extends Rest Line 223  public class Functional_ORB extends Rest
223     * serving multiple requests (probably to the different objects) on the same     * serving multiple requests (probably to the different objects) on the same
224     * thread.     * thread.
225     */     */
226    class sharedPortServer extends portServer    protected class sharedPortServer extends portServer
227    {    {
228      /**      /**
229       * Create a new portServer, serving on specific port.       * Create a new portServer, serving on specific port.
# Line 395  public class Functional_ORB extends Rest Line 396  public class Functional_ORB extends Rest
396    /**    /**
397     * The currently active portServers.     * The currently active portServers.
398     */     */
399    private ArrayList portServers = new ArrayList();    protected ArrayList portServers = new ArrayList();
400    
401    /**    /**
402     * The host, on that the name service is expected to be running.     * The host, on that the name service is expected to be running.
# Line 964  public class Functional_ORB extends Rest Line 965  public class Functional_ORB extends Rest
965        
966    /**    /**
967     * Start the server in a new thread, if not already running. This method is     * Start the server in a new thread, if not already running. This method is
968     * used to ensure that the objects being transfered will be served fro the     * used to ensure that the objects being transfered will be served from the
969     * remote side, if required. If the ORB is started using this method, it     * remote side, if required. If the ORB is started using this method, it
970     * starts as a daemon thread.     * starts as a daemon thread.
971     */     */
# Line 1233  public class Functional_ORB extends Rest Line 1234  public class Functional_ORB extends Rest
1234     * @throws BAD_PARAM if the object does not implement the     * @throws BAD_PARAM if the object does not implement the
1235     * {@link InvokeHandler}).     * {@link InvokeHandler}).
1236     */     */
1237    private void prepareObject(org.omg.CORBA.Object object, IOR ior)    protected void prepareObject(org.omg.CORBA.Object object, IOR ior)
1238      throws BAD_PARAM      throws BAD_PARAM
1239    {    {
1240      /*      /*
# Line 1587  public class Functional_ORB extends Rest Line 1588  public class Functional_ORB extends Rest
1588          return;          return;
1589        }        }
1590    }    }
1591      
1592    private void useProperties(Properties props)    /**
1593       * Set the ORB parameters from the properties that were accumulated
1594       * from several locations.
1595       */
1596      protected void useProperties(Properties props)
1597    {    {
1598      if (props != null)      if (props != null)
1599        {        {

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26