org.springframework.remoting.rmi.RmiServiceExporter Java Examples

The following examples show how to use org.springframework.remoting.rmi.RmiServiceExporter. 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 File: AbstractEntityModel.java    From OpERP with 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 File: BusinessRmiContext.java    From OpERP with 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 #3
Source File: ItemRmiContext.java    From OpERP with 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;
}
 
Example #4
Source File: ItemRmiContext.java    From OpERP with 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 #5
Source File: ItemRmiContext.java    From OpERP with 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 #6
Source File: ItemRmiContext.java    From OpERP with 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 #7
Source File: ItemRmiContext.java    From OpERP with 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 #8
Source File: AccountRmiContext.java    From OpERP with 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 #9
Source File: AccountRmiContext.java    From OpERP with 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 #10
Source File: AccountRmiContext.java    From OpERP with 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 #11
Source File: AccountRmiContext.java    From OpERP with 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 #12
Source File: EmployeeRmiContext.java    From OpERP with 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 #13
Source File: BusinessRmiContext.java    From OpERP with 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 File: RmiServerConfig.java    From Spring with 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 #15
Source File: PartyRmiContext.java    From OpERP with 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 #16
Source File: PartyRmiContext.java    From OpERP with 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 #17
Source File: CommonRmiContext.java    From OpERP with 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 #18
Source File: CommonRmiContext.java    From OpERP with 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 #19
Source File: StockRmiContext.java    From OpERP with 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 #20
Source File: StockRmiContext.java    From OpERP with 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 #21
Source File: StockRmiContext.java    From OpERP with 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 #22
Source File: RmiRemoteInputStreamServer.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
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 #23
Source File: RmiServerConfig.java    From Spring with 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;
}