FileDocCategorySizeDatePackage
FilterRegistry.javaAPI DocGlassfish v2 API5548Fri May 04 22:24:42 BST 2007com.sun.enterprise.admin.wsmgmt.filter.spi

FilterRegistry

public class FilterRegistry extends Object
This class interacts with JAX RPC Monitoring SPI and registers Global Listener to get callbacks.

Fields Summary
private static FilterRegistry
fm
private static HashMap
managedEndpoints
private static HashMap
filters
public static final String
DELIM
Constructors Summary
private FilterRegistry()


      
Methods Summary
public java.util.ListgetFilters(java.lang.String stage, java.lang.String endpoint)

        return (List) filters.get(stage + DELIM + endpoint);
    
public FilterRegistration[]getFilters(java.lang.String endpoint)

        return null;
    
public static synchronized com.sun.enterprise.admin.wsmgmt.filter.spi.FilterRegistrygetInstance()

        if ( fm == null) {
            fm = new FilterRegistry();
        }
        if ( managedEndpoints == null ) {
            managedEndpoints = new HashMap();
        }
        if ( filters == null ) {
            filters = new HashMap();
        }
        return fm;
    
public booleanisManaged(java.lang.String endpoint)

        if ( managedEndpoints == null)
            return false;
        else {
             Object o = managedEndpoints.get(endpoint);
             if ( o != null) {
                return true;
             } else {
                return false;
             }
        }
    
public synchronized voidregisterFilter(java.lang.String stage, java.lang.String endpoint, Filter filter)


        List fl = (List) filters.get( stage + DELIM + endpoint);
        if ( fl == null ) {
            fl = new ArrayList();
        }
        fl.add(filter);
        filters.put(stage + DELIM + endpoint, fl); 
        setManaged(endpoint);
    
public voidsetManaged(java.lang.String endpoint)

        managedEndpoints.put(endpoint, Boolean.valueOf(true));
    
public voidsetUnManaged(java.lang.String endpoint)

        managedEndpoints.remove(endpoint);
    
public voidunregisterAllFilters(java.lang.String endpoint)

        Iterator itr = filters.keySet().iterator();
        while ( itr.hasNext()) {
            String key = (String) itr.next();
            if ( key.contains( DELIM+endpoint) ) {
                itr.remove();
            }
        }
    
public voidunregisterFilter(java.lang.String stage, java.lang.String endpoint, Filter filter)

        List fl = (List) filters.get( stage + DELIM + endpoint);
        if ( fl == null ) {
            throw new IllegalArgumentException(" No registration exists for " +
                stage + DELIM + endpoint );
        }
        fl.remove(fl.indexOf(filter));
        if ( filters.isEmpty() ) {
            // this is the last filter, set this web service as un-managed
            setUnManaged(endpoint);
        }
    
public voidunregisterFilterByName(java.lang.String stage, java.lang.String endpoint, java.lang.String filtername)


        List fl = (List) filters.get( stage + DELIM + endpoint);
        if ( fl == null ) {
            throw new IllegalArgumentException(" No registration exists for " +
                stage + DELIM + endpoint );
        }
        Iterator fli = fl.iterator();
        while (fli.hasNext()) {
            Filter f = (Filter) fli.next();
            if (f.getName().equals(filtername)) {
                fli.remove();
                continue;
            }
        }

        if ( filters.isEmpty() ) {
            // this is the last filter, set this web service as un-managed
            setUnManaged(endpoint);
        }