Skip to content

Commit

Permalink
[ALL] Doc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
fabioal0 committed Jun 7, 2020
1 parent 8f5cd09 commit 67b5055
Show file tree
Hide file tree
Showing 15 changed files with 110 additions and 76 deletions.
20 changes: 12 additions & 8 deletions src/main/ArrivalLoungeServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,33 @@

public class ArrivalLoungeServer {

/**
* Listening port number of the service provided
*
* @serialField portNumb
*/
private static final int portNumb = 33002;
public static int waitConnection;

public static void main (String [] args)
{
/**
* Main program.
*/

public static void main (String [] args) {

ServiceProviderProxy serviceProviderProxy;
ArrivalLoungeProxy arrivalLoungeProxy;
ArrivalLounge arrivalLounge ;
ServerCom scon, sconi;

// Start service

scon = new ServerCom(portNumb);
scon.start ();
arrivalLounge = new ArrivalLounge(new RepositoryStub("localhost", 33001));
System.out.println ("O serviço foi estabelecido!");
System.out.println ("O servidor esta em escuta.");

// Process requests

waitConnection = 0;
while (waitConnection!=3)
try
Expand All @@ -38,11 +45,8 @@ public static void main (String [] args)
serviceProviderProxy= new ServiceProviderProxy( arrivalLoungeProxy,sconi);
serviceProviderProxy.start ();
}
catch (SocketTimeoutException e)
{
}
catch (SocketTimeoutException ignored) {}
scon.end ();
System.out.println ("O servidor foi desactivado.");
}

}
19 changes: 11 additions & 8 deletions src/main/ArrivalQuayServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,32 @@

public class ArrivalQuayServer {

/**
* Listening port number of the service provided
*
* @serialField portNumb
*/
private static final int portNumb = 33003;
public static int waitConnection;

public static void main (String [] args)
{
/**
* Main program.
*/
public static void main (String [] args) {

ServiceProviderProxy serviceProviderProxy;
ArrivalQuayProxy arrivalQuayProxy;
ArrivalQuay arrivalQuay ;
ServerCom scon, sconi;

// Start service

scon = new ServerCom(portNumb);
scon.start ();
arrivalQuay = new ArrivalQuay(new RepositoryStub("localhost", 33001), new ArrivalLoungeStub("localhost", 33002));
System.out.println ("O serviço foi estabelecido!");
System.out.println ("O servidor esta em escuta.");

// Process requests

waitConnection = 0;
while (waitConnection!=3)
try
Expand All @@ -39,11 +45,8 @@ public static void main (String [] args)
serviceProviderProxy= new ServiceProviderProxy( arrivalQuayProxy,sconi);
serviceProviderProxy.start ();
}
catch (SocketTimeoutException e)
{
}
catch (SocketTimeoutException ignored) {}
scon.end ();
System.out.println ("O servidor foi desactivado.");
}

}
13 changes: 10 additions & 3 deletions src/main/ArrivalTerminalExitServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,25 @@

public class ArrivalTerminalExitServer {

/**
* Listening port number of the service provided
*
* @serialField portNumb
*/
private static final int portNumb = 33004;
public static int waitConnection;

public static void main (String [] args)
{
/**
* Main program.
*/
public static void main (String [] args) {

ServiceProviderProxy serviceProviderProxy;
ArrivalTerminalExitProxy arrivalTerminalExitProxy;
ArrivalTerminalExit arrivalTerminalExit ;
ServerCom scon, sconi;

// Start service

scon = new ServerCom(portNumb);
scon.start ();
arrivalTerminalExit = new ArrivalTerminalExit(new RepositoryStub("localhost", 33001),new ArrivalLoungeStub("localhost", 33002), new DepartureTerminalEntranceStub("localhost", 33008));
Expand Down
19 changes: 11 additions & 8 deletions src/main/BagColPointServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,32 @@

public class BagColPointServer {

/**
* Listening port number of the service provided
*
* @serialField portNumb
*/
private static final int portNumb = 33005;
public static int waitConnection;

public static void main (String [] args)
{
/**
* Main program.
*/
public static void main (String [] args) {

ServiceProviderProxy serviceProviderProxy;
BagColPointProxy bagColPointProxy;
BagColPoint bagColPoint ;
ServerCom scon, sconi;

// Start service

scon = new ServerCom(portNumb);
scon.start ();
bagColPoint = new BagColPoint(new RepositoryStub("localhost", 33001));
System.out.println ("O serviço foi estabelecido!");
System.out.println ("O servidor esta em escuta.");

// Process requests

waitConnection = 0;
while (waitConnection!=3)
try
Expand All @@ -38,11 +44,8 @@ public static void main (String [] args)
serviceProviderProxy= new ServiceProviderProxy( bagColPointProxy,sconi);
serviceProviderProxy.start ();
}
catch (SocketTimeoutException e)
{
}
catch (SocketTimeoutException ignored) {}
scon.end ();
System.out.println ("O servidor foi desactivado.");
}

}
19 changes: 11 additions & 8 deletions src/main/BagRecOfficeServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,32 @@

public class BagRecOfficeServer {

/**
* Listening port number of the service provided
*
* @serialField portNumb
*/
private static final int portNumb = 33006;
public static int waitConnection;

public static void main (String [] args)
{
/**
* Main program.
*/
public static void main (String [] args) {

ServiceProviderProxy serviceProviderProxy;
BagRecOfficeProxy bagRecOfficeProxy;
BagRecOffice bagRecOffice ;
ServerCom scon, sconi;

// Start service

scon = new ServerCom(portNumb);
scon.start ();
bagRecOffice = new BagRecOffice(new RepositoryStub("localhost", 33001));
System.out.println ("O serviço foi estabelecido!");
System.out.println ("O servidor esta em escuta.");

// Process requests

waitConnection = 0;
while (waitConnection!=3)
try
Expand All @@ -38,11 +44,8 @@ public static void main (String [] args)
serviceProviderProxy= new ServiceProviderProxy( bagRecOfficeProxy,sconi);
serviceProviderProxy.start ();
}
catch (SocketTimeoutException e)
{
}
catch (SocketTimeoutException ignored) {}
scon.end ();
System.out.println ("O servidor foi desactivado.");
}

}
6 changes: 3 additions & 3 deletions src/main/ClientBusDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ public class ClientBusDriver {
public static void main(String[] args) {

// Global variables.
int N_passengers = 6;
int T_seats = 3;

//
String fName="Log.txt"; // logging file name
// Server global variables.
String baseServerHostName = "localhost"; // name from the machine where the server is
int baseServerPortNumb=33000; // server port number

Expand Down Expand Up @@ -43,6 +41,8 @@ public static void main(String[] args) {
System.out.println(ex.getMessage());
System.exit(1);
}

//Shutdown
arrivalLounge.shutdown(1);
arrivalQuay.shutdown(1);
arrivalTerminalExit.shutdown(1);
Expand Down
4 changes: 2 additions & 2 deletions src/main/ClientPassenger.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ public static void main(String[] args) {
int M_luggage = 2;
int T_seats = 3;

//
String fName="Log.txt"; // logging file name
// Server global variables.
String baseServerHostName = "localhost"; // name from the machine where the server is
int baseServerPortNumb=33000; // server port number

Expand Down Expand Up @@ -122,6 +121,7 @@ public static void main(String[] args) {
plainBags.clear();
}

//Shutdown
arrivalLounge.shutdown(1);
arrivalQuay.shutdown(1);
arrivalTerminalExit.shutdown(1);
Expand Down
6 changes: 3 additions & 3 deletions src/main/ClientPorter.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ public static void main(String[] args) {
// Global variables.
int K_landings = 5;
int N_passengers = 6;
int T_seats = 3;

//
String fName="Log.txt"; // logging file name
// Server global variables.
String baseServerHostName = "localhost"; // name from the machine where the server is
int baseServerPortNumb=33000; // server port number

Expand Down Expand Up @@ -44,6 +42,8 @@ public static void main(String[] args) {
System.out.println(ex.getMessage());
System.exit(1);
}

//Shutdown
arrivalLounge.shutdown(1);
arrivalQuay.shutdown(1);
arrivalTerminalExit.shutdown(1);
Expand Down
15 changes: 10 additions & 5 deletions src/main/DepartureQuayServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,32 @@

public class DepartureQuayServer {

/**
* Listening port number of the service provided
*
* @serialField portNumb
*/
private static final int portNumb = 33007;
public static int waitConnection;

public static void main (String [] args)
{
/**
* Main program.
*/
public static void main (String [] args) {

ServiceProviderProxy serviceProviderProxy;
DepartureQuayProxy departureQuayProxy;
DepartureQuay departureQuay;
ServerCom scon, sconi;

// Start service

scon = new ServerCom(portNumb);
scon.start ();
departureQuay = new DepartureQuay(new RepositoryStub("localhost", 33001));
System.out.println ("O serviço foi estabelecido!");
System.out.println ("O servidor esta em escuta.");

// Process requests

waitConnection = 0;
while (waitConnection!=3)
try
Expand All @@ -44,5 +50,4 @@ public static void main (String [] args)
scon.end ();
System.out.println ("O servidor foi desactivado.");
}

}
19 changes: 11 additions & 8 deletions src/main/DepartureTerminalEntranceServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,32 @@

public class DepartureTerminalEntranceServer {

/**
* Listening port number of the service provided
*
* @serialField portNumb
*/
private static final int portNumb = 33008;
public static int waitConnection;

public static void main (String [] args)
{
/**
* Main program.
*/
public static void main (String [] args){

ServiceProviderProxy serviceProviderProxy;
DepartureTerminalEntranceProxy departureTerminalEntranceProxy;
DepartureTerminalEntrance departureTerminalEntrance;
ServerCom scon, sconi;

// Start service

scon = new ServerCom(portNumb);
scon.start ();
departureTerminalEntrance = new DepartureTerminalEntrance(new RepositoryStub("localhost", 33001),new ArrivalLoungeStub("localhost", 33002), new ArrivalTerminalExitStub("localhost", 33004));
System.out.println ("O serviço foi estabelecido!");
System.out.println ("O servidor esta em escuta.");

// Process requests

waitConnection = 0;
while (waitConnection!=3)
try
Expand All @@ -40,11 +46,8 @@ public static void main (String [] args)
serviceProviderProxy= new ServiceProviderProxy( departureTerminalEntranceProxy,sconi);
serviceProviderProxy.start ();
}
catch (SocketTimeoutException e)
{
}
catch (SocketTimeoutException ignored) {}
scon.end ();
System.out.println ("O servidor foi desactivado.");
}

}
Loading

0 comments on commit 67b5055

Please sign in to comment.