1
package org.jboss.test.remoting.transporter.proxy;
3
import org.jboss.remoting.transporter.TransporterClient;
4
import org.jboss.remoting.transporter.TransporterServer;
6
import java.util.Random;
9
* @author <a href="mailto:tom.elrod@jboss.com">Tom Elrod</a>
11
public class CustomerProcessorImpl implements CustomerProcessor, Auditor
13
private String locatorURI = "socket://localhost:5401";
15
private int callCounter = 0;
16
public static final String COMPANYNAME = "acme co.";
19
* Takes the customer passed, and if not null and customer id
20
* is less than 0, will create a new random id and set it.
21
* The customer object returned will be the modified customer
27
public ICustomer processCustomer(Customer customer)
29
if (customer != null && customer.getCustomerId() < 0)
31
customer.setCustomerId(new Random().nextInt(1000));
34
ICustomer customerProxy = null;
37
TransporterServer server = TransporterServer.createTransporterServer(locatorURI, customer, ICustomer.class.getName());
38
customerProxy = (ICustomer) TransporterClient.createTransporterClient(locatorURI, ICustomer.class);
47
System.out.println("processed customer with new id of " + customerProxy.getCustomerId());
51
public String getCompanyName()
56
public int getNumberOfCalls()