Package mx4j.log

Examples of mx4j.log.Logger


   public void sendRelationRemovalNotification(String relationId, List unregisteredMBeanList) throws IllegalArgumentException,
                                                                                                     RelationNotFoundException
   {
      if (relationId == null) throw new IllegalArgumentException("Null RelationId");

      Logger logger = getLogger();
      if (logger.isEnabledFor(Logger.DEBUG)) logger.debug("sending relationRemovalNotification of ID: " + relationId);
      StringBuffer message = new StringBuffer("Removal of relation ");
      message.append(relationId);
      String relationTypeName = getRelationTypeNameFromMap(relationId);
      ObjectName relationObjectName = isRelationMBean(relationId);
      String notificationType;
View Full Code Here


      isActive();
      if (relationId == null) throw new IllegalArgumentException("Null Relation Id");
      if (role == null) throw new IllegalArgumentException("Null Role");
      if (oldRoleValues == null) throw new IllegalArgumentException("Null Role value list.");

      Logger logger = getLogger();
      if (logger.isEnabledFor(Logger.DEBUG)) logger.debug("Updating the RelationService RoleMap");

      String roleName = role.getRoleName();
      List newRoleValue = role.getRoleValue();

      // clone as the list is to be modified later, cast to ArrayList as List does not define clone()
View Full Code Here

   public void removeRelation(String relationId) throws IllegalArgumentException, RelationServiceNotRegisteredException,
                                                        RelationNotFoundException
   {
      isActive();
      if (relationId == null) throw new IllegalArgumentException("Null Relation Id");
      Logger logger = getLogger();
      if (logger.isEnabledFor(Logger.DEBUG)) logger.debug("Removing a Relation from the RelationService.");
      Object result = getRelationObject(relationId);
      if (result instanceof ObjectName)
      {
         // add the objectName to List
         List obsoleteReferences = new ArrayList();
View Full Code Here

    *          - if the Relation Service is not registered in the MBean Server.
    */
   public void purgeRelations() throws RelationServiceNotRegisteredException
   {
      isActive();
      Logger logger = getLogger();
      if (logger.isEnabledFor(Logger.DEBUG)) logger.debug("purging relations");

      ArrayList localDeregisteredNotificationList;
      synchronized (m_deregisteredNotificationList)
      {
         // cone the list of notifications to be able to recieve notification while processing current ones
View Full Code Here

    */
   public Map findReferencingRelations(ObjectName mbeanObjectName, String relationTypeName, String roleName) throws
                                                                                                             IllegalArgumentException
   {
      if (mbeanObjectName == null) throw new IllegalArgumentException("Cannot find references for a null ObjectName");
      Logger logger = getLogger();
      if (logger.isEnabledFor(Logger.DEBUG))
         logger.debug("finding referencing relations for MBean with ObjectName: "
                      + mbeanObjectName.getCanonicalName() + " and relationTypeName: " + relationTypeName + " and roleName: " + roleName);
      HashMap result = new HashMap();
      HashMap relationIdMap = (HashMap)getReferencedMBeansFromMap(mbeanObjectName);
      if (relationIdMap != null)
      {
View Full Code Here

    */
   public Map findAssociatedMBeans(ObjectName mbeanObjectName, String relationTypeName, String roleName) throws
                                                                                                         IllegalArgumentException
   {
      if (mbeanObjectName == null) throw new IllegalArgumentException("mbean ObjectName cannot be null.");
      Logger logger = getLogger();
      if (logger.isEnabledFor(Logger.DEBUG))
         logger.debug("finding associated relations for MBean with ObjectName: "
                      + mbeanObjectName.getCanonicalName() + " and relationTypeName: " + relationTypeName + " and roleName: " + roleName);
      Map relationIdsToRoleNames = findReferencingRelations(mbeanObjectName, relationTypeName, roleName);
      Map result = new HashMap();
      for (Iterator i = (relationIdsToRoleNames.keySet()).iterator(); i.hasNext();)
      {
         String currentRelationId = (String)i.next();
         HashMap objectNamesToRoleMap;
         try
         {
            objectNamesToRoleMap = (HashMap)(getReferencedMBeans(currentRelationId));
         }
         catch (RelationNotFoundException ex)
         {
            logger.warn("Relation with ID: " + currentRelationId + " not found.");
            throw new RuntimeOperationsException(null, "Relation Not Found");
         }
         for (Iterator iter = (objectNamesToRoleMap.keySet()).iterator(); iter.hasNext();)
         {
            ObjectName objectName = (ObjectName)iter.next();
View Full Code Here

    * @throws RelationTypeNotFoundException - if there is no relation type with that name
    */
   public List findRelationsOfType(String relationTypeName) throws IllegalArgumentException, RelationTypeNotFoundException
   {
      if (relationTypeName == null) throw new IllegalArgumentException("relation type name cannot be null.");
      Logger logger = getLogger();
      if (logger.isEnabledFor(Logger.DEBUG)) logger.debug("finding relations matching relationTypeName: " + relationTypeName);

      // throws RelationTypeNotFoundException if not found
      getRelationType(relationTypeName);

      List relationIdList = getRelationIds(relationTypeName);
View Full Code Here

    * @throws RelationNotFoundException - if no relation for given relation id
    */
   public Map getReferencedMBeans(String relationId) throws IllegalArgumentException, RelationNotFoundException
   {
      if (relationId == null) throw new IllegalArgumentException("Null Relation Id");
      Logger logger = getLogger();
      if (logger.isEnabledFor(Logger.DEBUG)) logger.debug("getting MBeans referenced for ID: " + relationId);
      Relation relation = getRelation(relationId);
      return relation.getReferencedMBeans();
   }
View Full Code Here

    * @throws RelationNotFoundException - if no relation for given relation id
    */
   public String getRelationTypeName(String relationId) throws IllegalArgumentException, RelationNotFoundException
   {
      if (relationId == null) throw new IllegalArgumentException("Null Relation Id");
      Logger logger = getLogger();
      if (logger.isEnabledFor(Logger.DEBUG)) logger.debug("getting the relationType for ID: " + relationId);
      Relation relation = getRelation(relationId);
      return relation.getRelationTypeName();
   }
View Full Code Here

    *                         The value false means that the registration phase has failed
    * @see MBeanRegistration
    */
   public void postRegister(Boolean registrationDone)
   {
      Logger logger = getLogger();
      boolean done = registrationDone.booleanValue();
      if (!done)
      {
         m_server = null;
         logger.warn("Relation service was NOT registered");
      }
      else
      {
         if (logger.isEnabledFor(Logger.DEBUG))
         {
            logger.debug("Relation service postRegistered");
         }
      }
   }
View Full Code Here

TOP

Related Classes of mx4j.log.Logger

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.