Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.ArrayList;
- import org.omg.PortableServer.Servant;
- import bank.Account;
- public class MyServer {
- public static void main(String[] args) {
- Server s = new Server(args);
- ArrayList<Account> accounts = new ArrayList<Account>();
- // create a Servant object
- Servant customer = new CustomerImpl(accounts);
- Servant administrator = new AdministratorImpl(accounts);
- Servant customerWS = new CustomerWSImpl(accounts);
- if (args.length == 0) {
- s.attach(customer, null);
- s.attach(administrator, null);
- s.attach(customerWS, null);
- s.closeFile();
- } else {
- // define the context
- String nameContext1 = "Bank.cxt";
- // build the context
- s.bindContext(nameContext1);
- // put objects into context
- s.attach(customer, nameContext1 + "/" + "customer.service");
- s.attach(administrator, nameContext1 + "/" + "admin.service");
- }
- s.run();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement