Clover coverage report -
Coverage timestamp: Thu Jul 5 2007 20:02:32 EDT
file stats: LOC: 204   Methods: 0
NCLOC: 34   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
PojoCacheJmxWrapperMBean.java - - - -
coverage
 1    /*
 2    * JBoss, Home of Professional Open Source.
 3    * Copyright 2006, Red Hat Middleware LLC, and individual contributors
 4    * as indicated by the @author tags. See the copyright.txt file in the
 5    * distribution for a full listing of individual contributors.
 6    *
 7    * This is free software; you can redistribute it and/or modify it
 8    * under the terms of the GNU Lesser General Public License as
 9    * published by the Free Software Foundation; either version 2.1 of
 10    * the License, or (at your option) any later version.
 11    *
 12    * This software is distributed in the hope that it will be useful,
 13    * but WITHOUT ANY WARRANTY; without even the implied warranty of
 14    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 15    * Lesser General Public License for more details.
 16    *
 17    * You should have received a copy of the GNU Lesser General Public
 18    * License along with this software; if not, write to the Free
 19    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 20    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 21    */
 22    package org.jboss.cache.pojo.jmx;
 23   
 24    import org.jboss.cache.Cache;
 25    import org.jboss.cache.CacheStatus;
 26    import org.jboss.cache.config.Configuration;
 27    import org.jboss.cache.jmx.LegacyConfiguration;
 28    import org.jboss.cache.pojo.PojoCache;
 29    import org.jboss.cache.pojo.PojoCacheAlreadyDetachedException;
 30    import org.jboss.cache.pojo.PojoCacheException;
 31   
 32    /**
 33    * StandardMBean interface for {@link PojoCacheJmxWrapperMBean}.
 34    *
 35    * @author <a href="brian.stansberry@jboss.com">Brian Stansberry</a>
 36    * @version $Revision: 1.8 $
 37    */
 38    public interface PojoCacheJmxWrapperMBean extends LegacyConfiguration
 39    {
 40    /** The lifecycle method stop has completed */
 41    public static final int STOPPED = 0;
 42    /** The lifecycle method stop has been invoked */
 43    public static final int STOPPING = 1;
 44    /** The lifecycle method start has been invoked */
 45    public static final int STARTING = 2;
 46    /** The lifecycle method start has completed */
 47    public static final int STARTED = 3;
 48    /** There has been an error during some operation */
 49    public static final int FAILED = 4;
 50    /** The lifecycle method destroy has completed */
 51    public static final int DESTROYED = 5;
 52    /** The lifecycle method create has completed */
 53    public static final int CREATED = 6;
 54    /** The MBean has been instantiated but has not completed MBeanRegistration.postRegister */
 55    public static final int UNREGISTERED = 7;
 56    /** The MBean has been instantiated and has completed MBeanRegistration.postRegister */
 57    public static final int REGISTERED = 8;
 58   
 59    /**
 60    * Lifecycle method to start PojoCache.
 61    *
 62    * @throws PojoCacheException
 63    */
 64    void create() throws PojoCacheException;
 65   
 66    /**
 67    * Lifecycle method to start PojoCache.
 68    *
 69    * @throws PojoCacheException
 70    */
 71    void start() throws PojoCacheException;
 72   
 73    /**
 74    * Lifecycle method to stop PojoCache. Note that PojoCache can be stopped and started
 75    * repeatedly.
 76    *
 77    * @throws PojoCacheException
 78    */
 79    void stop() throws PojoCacheException;
 80   
 81    /**
 82    * Lifecycle method to destroy PojoCache.
 83    *
 84    * @throws PojoCacheException
 85    */
 86    void destroy() throws PojoCacheException;
 87   
 88    /**
 89    * Gets where this object is in its lifecycle transitions.
 90    *
 91    * @return the current status. Will not return <code>null</code>
 92    */
 93    CacheStatus getCacheStatus();
 94   
 95    /**
 96    * Legacy attribute to expose the {@link #getCacheStatus() cache status}
 97    * in terms of the JBoss AS ServiceMBean values. This interface does
 98    * not extend ServiceMBean, but this attribute is retained to provide
 99    * compatibility with the JBoss AS JSR-77 integration layer.
 100    *
 101    * @return the current status, e.g. {@link #STARTED}.
 102    */
 103    int getState();
 104   
 105    /**
 106    * Returns the PojoCache.
 107    *
 108    * @return the PojoCache
 109    */
 110    PojoCache getPojoCache();
 111   
 112    /**
 113    * Retrieves an immutable configuration.
 114    */
 115    Configuration getConfiguration();
 116   
 117    /**
 118    * Gets whether this object should register a {@link CacheJmxWrapperMBean}
 119    * for the underlying {@link Cache} with JMX.
 120    * <p/>
 121    * Default is <code>true</code>.
 122    */
 123    boolean getRegisterPlainCache();
 124   
 125    /**
 126    * Sets whether this object should register a {@link CacheJmxWrapperMBean}
 127    * for the underlying {@link Cache} with JMX.
 128    * <p/>
 129    * Default is <code>true</code>.
 130    * <p/>
 131    * If <code>true</code>, the <code>CacheJmxWrapperMBean</code> will be
 132    * instantiated and registered either as part of the registration of
 133    * this object, or during the call to {@link #create()}.
 134    */
 135    public void setRegisterPlainCache(boolean registerPlainCache);
 136   
 137    /**
 138    * Gets whether this object should register the cache's interceptors
 139    * with JMX.
 140    * <p/>
 141    * This property is only relevant if {@link #setRegisterPlainCache(boolean) registerPlainCache}
 142    * is <code>true</code>.
 143    * <p/>
 144    * Default is <code>true</code>.
 145    */
 146    boolean getRegisterInterceptors();
 147   
 148    /**
 149    * Sets whether this object should register the cache's interceptors
 150    * with JMX.
 151    * <p/>
 152    * This property is only relevant if {@link #setRegisterPlainCache(boolean) registerPlainCache}
 153    * is <code>true</code>.
 154    * <p/>
 155    * Default is <code>true</code>.
 156    */
 157    void setRegisterInterceptors(boolean register);
 158   
 159    /**
 160    * Return number of POJO attach operations for this particular id.
 161    * @return Number of attach operation.
 162    */
 163    // public long getNumberOfAttach();
 164   
 165    /**
 166    * Return number of POJO detach operations for this particular id.
 167    * @return Number of detach operation.
 168    */
 169    // public long getNumberOfDetach();
 170   
 171    /**
 172    * Return number of POJO field read operations for this particulxar id.
 173    * @param pojo That is associated with this POJO. If null, it means all POJOs in this cache system.
 174    * @return Number of field read operation.
 175    * @throws PojoCacheAlreadyDetachedException if pojo has been detached already.
 176    */
 177    // public long getNumberOfFieldRead(Object pojo) throws PojoCacheAlreadyDetachedException;
 178   
 179    /**
 180    * Return number of POJO field write operations for this particular id.
 181    * @param pojo That is associated with this POJO. If null, it means all POJOs in this cache system.
 182    * @return Number of field read operation.
 183    * @throws PojoCacheAlreadyDetachedException if pojo has been detached already.
 184    */
 185    // public long getNumberOfFieldWrite(Object pojo) throws PojoCacheAlreadyDetachedException;
 186   
 187    /**
 188    * Reset all stats.
 189    */
 190    // public void reset();
 191   
 192    /**
 193    * Obtain the internal location of this pojo stored under PojoCache.
 194    * @param pojo That is associated with this POJO. If null, it means all POJOs in this cache system.
 195    * @return String that indicates the location.
 196    * @throws PojoCacheAlreadyDetachedException if pojo has been detached already.
 197    */
 198    public String getInternalLocation(Object pojo) throws PojoCacheAlreadyDetachedException;
 199   
 200    /**
 201    * Get the MBean object name that the underlying replicated cache is using.
 202    */
 203    public String getUnderlyingCacheObjectName();
 204    }