Java Code Examples for org.springframework.remoting.rmi.RmiServiceExporter

The following examples show how to use org.springframework.remoting.rmi.RmiServiceExporter. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: OpERP   Source File: AbstractEntityModel.java    License: MIT License 6 votes vote down vote up
@PostConstruct
public void registerWithServer() {
	AutowireCapableBeanFactory factory = context
			.getAutowireCapableBeanFactory();
	BeanDefinitionRegistry registry = (BeanDefinitionRegistry) factory;
	GenericBeanDefinition beanDefinition = new GenericBeanDefinition();
	beanDefinition.setBeanClass(RmiServiceExporter.class);
	beanDefinition.setAutowireCandidate(true);

	MutablePropertyValues propertyValues = new MutablePropertyValues();

	Class<?> serviceInterface = this.getClass().getInterfaces()[0];

	propertyValues.addPropertyValue("serviceInterface", serviceInterface);
	String serviceName = serviceInterface.getCanonicalName();
	propertyValues.addPropertyValue("serviceName", serviceName);
	propertyValues.addPropertyValue("service", this);
	propertyValues.addPropertyValue("registryPort", "1099");
	beanDefinition.setPropertyValues(propertyValues);

	registry.registerBeanDefinition(serviceName, beanDefinition);
	context.getBean(serviceName); // Need this else
									// NotBoundException
	getService().registerClient(getHostAddress());

}
 
Example 2
Source Project: Spring   Source File: RmiServerConfig.java    License: Apache License 2.0 5 votes vote down vote up
@Bean
public RmiServiceExporter rmiServiceExporter() {
    final RmiServiceExporter exporter = new RmiServiceExporter();
    exporter.setRegistryPort(1098);
    exporter.setAlwaysCreateRegistry(true);
    exporter.setServiceName("userService");
    exporter.setServiceInterface(UserService.class);
    exporter.setService(userService());
    return exporter;
}
 
Example 3
Source Project: Spring   Source File: RmiServerConfig.java    License: Apache License 2.0 5 votes vote down vote up
@Bean
public RmiServiceExporter userService() {
    final RmiServiceExporter exporter = new RmiServiceExporter();
    exporter.setRegistryPort(1099);
    exporter.setAlwaysCreateRegistry(true);
    exporter.setServiceName("userService");
    exporter.setServiceInterface(UserService.class);
    exporter.setService(userService);
    return exporter;
}
 
Example 4
public String start(String host, int port) throws RemoteException
{
    String name = inputStream.getClass().getName() + UUID.randomUUID();
    rmiServiceExporter = new RmiServiceExporter();
    rmiServiceExporter.setServiceName(name);
    rmiServiceExporter.setRegistryPort(port);
    rmiServiceExporter.setRegistryHost(host);
    rmiServiceExporter.setServiceInterface(RemoteInputStreamServer.class);
    rmiServiceExporter.setService(this);
    rmiServiceExporter.afterPropertiesSet();
    return name;
}
 
Example 5
Source Project: OpERP   Source File: StockRmiContext.java    License: MIT License 5 votes vote down vote up
@Bean
public RmiServiceExporter rmiStockServiceExporter() {
	RmiServiceExporter rmiServiceExportor = new RmiServiceExporter();
	rmiServiceExportor.setServiceName("StockService");
	rmiServiceExportor.setServiceInterface(StockService.class);
	rmiServiceExportor.setService(stockService);
	rmiServiceExportor.setRegistryPort(1099);
	return rmiServiceExportor;

}
 
Example 6
Source Project: OpERP   Source File: StockRmiContext.java    License: MIT License 5 votes vote down vote up
@Bean
public RmiServiceExporter rmiWarehouseServiceExporter() {
	RmiServiceExporter rmiServiceExporter = new RmiServiceExporter();
	rmiServiceExporter.setServiceName("WarehouseService");
	rmiServiceExporter.setServiceInterface(WarehouseService.class);
	rmiServiceExporter.setService(warehouseService);
	return rmiServiceExporter;
}
 
Example 7
Source Project: OpERP   Source File: StockRmiContext.java    License: MIT License 5 votes vote down vote up
@Bean
public RmiServiceExporter rmiStockKeeperServiceExporter() {
	RmiServiceExporter rmiServiceExporter = new RmiServiceExporter();
	rmiServiceExporter.setServiceName("StockKeeperService");
	rmiServiceExporter.setServiceInterface(StockKeeperService.class);
	rmiServiceExporter.setService(stockKeeperService);
	return rmiServiceExporter;
}
 
Example 8
Source Project: OpERP   Source File: CommonRmiContext.java    License: MIT License 5 votes vote down vote up
@Bean
public RmiServiceExporter rmiAddressServiceExporter() {
	RmiServiceExporter rmiServiceExporter = new RmiServiceExporter();
	rmiServiceExporter.setServiceName("AddressService");
	rmiServiceExporter.setServiceInterface(AddressService.class);
	rmiServiceExporter.setService(addressService);
	rmiServiceExporter.setRegistryPort(1099);
	return rmiServiceExporter;
}
 
Example 9
Source Project: OpERP   Source File: CommonRmiContext.java    License: MIT License 5 votes vote down vote up
@Bean
public RmiServiceExporter rmiContactInfoServiceExporter() {
	RmiServiceExporter rmiServiceExporter = new RmiServiceExporter();
	rmiServiceExporter.setServiceName("ContactInfoService");
	rmiServiceExporter.setServiceInterface(ContactInfoService.class);
	rmiServiceExporter.setService(contactInfoService);
	rmiServiceExporter.setRegistryPort(1099);
	return rmiServiceExporter;
}
 
Example 10
Source Project: OpERP   Source File: PartyRmiContext.java    License: MIT License 5 votes vote down vote up
@Bean
public RmiServiceExporter rmiVendorServiceExporter() {
	RmiServiceExporter rmiServiceExportor = new RmiServiceExporter();
	rmiServiceExportor.setServiceName("VendorService");
	rmiServiceExportor.setServiceInterface(VendorService.class);
	rmiServiceExportor.setService(vendorService);
	rmiServiceExportor.setRegistryPort(1099);
	return rmiServiceExportor;
}
 
Example 11
Source Project: OpERP   Source File: PartyRmiContext.java    License: MIT License 5 votes vote down vote up
@Bean
public RmiServiceExporter rmiCustomerServiceExporter() {
	RmiServiceExporter rmiServiceExportor = new RmiServiceExporter();
	rmiServiceExportor.setServiceName("CustomerService");
	rmiServiceExportor.setServiceInterface(CustomerService.class);
	rmiServiceExportor.setService(customerService);
	rmiServiceExportor.setRegistryPort(1099);
	return rmiServiceExportor;
}
 
Example 12
Source Project: OpERP   Source File: BusinessRmiContext.java    License: MIT License 5 votes vote down vote up
@Bean
public RmiServiceExporter rmiSaleServiceExporter() {
	RmiServiceExporter rmiServiceExportor = new RmiServiceExporter();
	rmiServiceExportor.setServiceInterface(SaleService.class);
	String serviceName = rmiServiceExportor.getServiceInterface()
			.getCanonicalName();
	rmiServiceExportor.setServiceName(serviceName);
	rmiServiceExportor.setService(saleService);
	rmiServiceExportor.setRegistryPort(1099);
	return rmiServiceExportor;
}
 
Example 13
Source Project: OpERP   Source File: BusinessRmiContext.java    License: MIT License 5 votes vote down vote up
@Bean
public RmiServiceExporter rmiPurchaseServiceExporter() {
	RmiServiceExporter rmiServiceExportor = new RmiServiceExporter();
	rmiServiceExportor.setServiceInterface(PurchaseService.class);
	String serviceName = rmiServiceExportor.getServiceInterface()
			.getCanonicalName();
	rmiServiceExportor.setServiceName(serviceName);
	rmiServiceExportor.setService(purchaseService);
	rmiServiceExportor.setRegistryPort(1099);
	return rmiServiceExportor;
}
 
Example 14
Source Project: OpERP   Source File: EmployeeRmiContext.java    License: MIT License 5 votes vote down vote up
@Bean
public RmiServiceExporter rmiEmployeeServiceExporter() {
	RmiServiceExporter rmiServiceExportor = new RmiServiceExporter();
	rmiServiceExportor.setServiceInterface(EmployeeService.class);
	String serviceName = rmiServiceExportor.getServiceInterface()
			.getCanonicalName();
	rmiServiceExportor.setServiceName(serviceName);
	rmiServiceExportor.setService(employeeService);
	rmiServiceExportor.setRegistryPort(1099);
	return rmiServiceExportor;
}
 
Example 15
Source Project: OpERP   Source File: AccountRmiContext.java    License: MIT License 5 votes vote down vote up
@Bean
public RmiServiceExporter rmiPayableAccountServiceExporter() {
	RmiServiceExporter rmiServiceExportor = new RmiServiceExporter();
	rmiServiceExportor.setServiceInterface(PayableAccountService.class);
	String serviceName = rmiServiceExportor.getServiceInterface()
			.getCanonicalName();
	rmiServiceExportor.setServiceName(serviceName);
	rmiServiceExportor.setService(payableAccountService);
	rmiServiceExportor.setRegistryPort(1099);
	return rmiServiceExportor;
}
 
Example 16
Source Project: OpERP   Source File: AccountRmiContext.java    License: MIT License 5 votes vote down vote up
@Bean
public RmiServiceExporter rmiReceivableAccountServiceExporter() {
	RmiServiceExporter rmiServiceExportor = new RmiServiceExporter();
	rmiServiceExportor.setServiceInterface(ReceivableAccountService.class);
	String serviceName = rmiServiceExportor.getServiceInterface()
			.getCanonicalName();
	rmiServiceExportor.setServiceName(serviceName);
	rmiServiceExportor.setService(receivableAccountService);
	rmiServiceExportor.setRegistryPort(1099);
	return rmiServiceExportor;
}
 
Example 17
Source Project: OpERP   Source File: AccountRmiContext.java    License: MIT License 5 votes vote down vote up
@Bean
public RmiServiceExporter rmiPaidTransactionServiceExporter() {
	RmiServiceExporter rmiServiceExportor = new RmiServiceExporter();
	rmiServiceExportor.setServiceInterface(PaidTransactionService.class);
	String serviceName = rmiServiceExportor.getServiceInterface()
			.getCanonicalName();
	rmiServiceExportor.setServiceName(serviceName);
	rmiServiceExportor.setService(paidTransactionService);
	rmiServiceExportor.setRegistryPort(1099);
	return rmiServiceExportor;
}
 
Example 18
Source Project: OpERP   Source File: AccountRmiContext.java    License: MIT License 5 votes vote down vote up
@Bean
public RmiServiceExporter rmiReceivedTransactionServiceExporter() {
	RmiServiceExporter rmiServiceExportor = new RmiServiceExporter();
	rmiServiceExportor
			.setServiceInterface(ReceivedTransactionService.class);
	String serviceName = rmiServiceExportor.getServiceInterface()
			.getCanonicalName();
	rmiServiceExportor.setServiceName(serviceName);
	rmiServiceExportor.setService(receivedTransactionService);
	rmiServiceExportor.setRegistryPort(1099);
	return rmiServiceExportor;
}
 
Example 19
Source Project: OpERP   Source File: ItemRmiContext.java    License: MIT License 5 votes vote down vote up
@Bean
public RmiServiceExporter rmiItemServiceExporter() {
	RmiServiceExporter rmiServiceExporter = new RmiServiceExporter();
	rmiServiceExporter.setServiceName("ItemService");
	rmiServiceExporter.setServiceInterface(ItemService.class);
	rmiServiceExporter.setService(itemService);
	rmiServiceExporter.setRegistryPort(1099); // default
	return rmiServiceExporter;
}
 
Example 20
Source Project: OpERP   Source File: ItemRmiContext.java    License: MIT License 5 votes vote down vote up
@Bean
public RmiServiceExporter rmiProductServiceExporter() {
	RmiServiceExporter rmiServiceExporter = new RmiServiceExporter();
	rmiServiceExporter.setServiceName("ProductService");
	rmiServiceExporter.setServiceInterface(ProductService.class);
	rmiServiceExporter.setService(productService);
	rmiServiceExporter.setRegistryPort(1099);
	return rmiServiceExporter;
}
 
Example 21
Source Project: OpERP   Source File: ItemRmiContext.java    License: MIT License 5 votes vote down vote up
@Bean
public RmiServiceExporter rmiBrandServiceExporter() {
	RmiServiceExporter rmiServiceExporter = new RmiServiceExporter();
	rmiServiceExporter.setServiceName("BrandService");
	rmiServiceExporter.setServiceInterface(BrandService.class);
	rmiServiceExporter.setService(brandService);
	rmiServiceExporter.setRegistryPort(1099);
	return rmiServiceExporter;
}
 
Example 22
Source Project: OpERP   Source File: ItemRmiContext.java    License: MIT License 5 votes vote down vote up
@Bean
public RmiServiceExporter rmiCategoryServiceExporter() {
	RmiServiceExporter rmiServiceExporter = new RmiServiceExporter();
	rmiServiceExporter.setServiceName("CategoryService");
	rmiServiceExporter.setServiceInterface(CategoryService.class);
	rmiServiceExporter.setService(categoryService);
	rmiServiceExporter.setRegistryPort(1099);
	return rmiServiceExporter;
}
 
Example 23
Source Project: OpERP   Source File: ItemRmiContext.java    License: MIT License 5 votes vote down vote up
@Bean
public RmiServiceExporter rmiManufacturerServiceExporter() {
	RmiServiceExporter rmiServiceExporter = new RmiServiceExporter();
	rmiServiceExporter.setServiceName("ManufacturerService");
	rmiServiceExporter.setServiceInterface(ManufacturerService.class);
	rmiServiceExporter.setService(manufacturerService);
	rmiServiceExporter.setRegistryPort(1099);
	return rmiServiceExporter;
}