JBoss Modular Service Kernel API 1.0.0.CR2

org.jboss.msc.service
Class ServiceNameMapper<V>

java.lang.Object
  extended by org.jboss.msc.service.ServiceNameMapper<V>

public final class ServiceNameMapper<V>
extends Object

A mapper for service names which allows a service name or pattern to be correlated with a value. If more than one pattern matches a service name, the best match is chosen; if there are multiple best matches then an arbitrary one is selected.

Author:
David M. Lloyd

Field Summary
static Object ANY
          The special marker which represents a pattern match.
 
Constructor Summary
ServiceNameMapper()
           
 
Method Summary
 V match(ServiceName serviceName)
          Attempt to match a service name.
 void registerMatcher(V value, Object... segments)
          Register a matcher for a specific location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ANY

public static final Object ANY
The special marker which represents a pattern match.

Constructor Detail

ServiceNameMapper

public ServiceNameMapper()
Method Detail

registerMatcher

public void registerMatcher(V value,
                            Object... segments)
Register a matcher for a specific location.

Parameters:
value - the value to register
segments - the segments to match

match

public V match(ServiceName serviceName)
Attempt to match a service name.

Parameters:
serviceName - the service name
Returns:
the value result, or null if no match was found

JBoss Modular Service Kernel API 1.0.0.CR2

Copyright © 2011 JBoss, a division of Red Hat, Inc.