Storing Information in a Registry Using JAXR
As a simple example of what you can do through JAXR, the following code adds a simple entry into a registry. To update the contents of a registry, you must interact with the business lifecycle manager. The Java representation of this, an instance of javax.xml.registry.BusinessLifecycleManager is obtained from the RegistryService instance, which is itself obtained from the connection:
RegistryService registryService = connection.getRegistryService(); BusinessLifecycleManager lifecycleManager = registryService.getBusinessLifeCycleManager();
You can then use the lifecycle manager to create entities within the registry. If you are adding a new organization, you use the createOrganization() method:
Get Sams Teach Yourself J2EE™ in 21 Days, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.