org.hibernate.service.spi.Manageable Java Examples

The following examples show how to use org.hibernate.service.spi.Manageable. 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: JmxServiceImpl.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void registerService(Manageable service, Class<? extends Service> serviceRole) {
	if ( OptionallyManageable.class.isInstance( service ) ) {
		for ( Manageable realManageable : ( (OptionallyManageable) service ).getRealManageables() ) {
			registerService( realManageable,serviceRole );
		}
		return;
	}

	final String domain = service.getManagementDomain() == null
			? AvailableSettings.JMX_DEFAULT_OBJ_NAME_DOMAIN
			: service.getManagementDomain();
	final String serviceType = service.getManagementServiceType() == null
			? service.getClass().getName()
			: service.getManagementServiceType();
	try {
		final ObjectName objectName = new ObjectName(
				String.format(
						OBJ_NAME_TEMPLATE,
						domain,
						sessionFactoryName,
						serviceRole.getName(),
						serviceType
				)
		);
		registerMBean( objectName, service.getManagementBean() );
	}
	catch ( MalformedObjectNameException e ) {
		throw new HibernateException( "Unable to generate service IbjectName", e );
	}
}
 
Example #2
Source File: AbstractServiceRegistryImpl.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
@SuppressWarnings({ "unchecked" })
public <R extends Service> void startService(ServiceBinding<R> serviceBinding) {
	if ( Startable.class.isInstance( serviceBinding.getService() ) ) {
		( (Startable) serviceBinding.getService() ).start();
	}

	if ( Manageable.class.isInstance( serviceBinding.getService() ) ) {
		getService( JmxService.class ).registerService(
				(Manageable) serviceBinding.getService(),
				serviceBinding.getServiceRole()
		);
	}
}
 
Example #3
Source File: Substitute_JmxServiceImpl.java    From quarkus with Apache License 2.0 4 votes vote down vote up
@Override
public void registerService(Manageable service, Class<? extends Service> serviceRole) {
    // no-op
}
 
Example #4
Source File: DisabledJmxServiceImpl.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void registerService(Manageable service, Class serviceRole) {
}
 
Example #5
Source File: HibernateSubstitutions.java    From micronaut-sql with Apache License 2.0 2 votes vote down vote up
@Override
public void registerService(Manageable service, Class<? extends Service> serviceRole) {

}
 
Example #6
Source File: JmxService.java    From lams with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Handles registration of a manageable service.
 *
 * @param service The manageable service
 * @param serviceRole The service's role.
 */
void registerService(Manageable service, Class<? extends Service> serviceRole);