Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Licensed to the Apache Software Foundation (ASF) under one or more
   * contributor license agreements.  See the NOTICE file distributed with
   * this work for additional information regarding copyright ownership.
   * The ASF licenses this file to You under the Apache License, Version 2.0
   * (the "License"); you may not use this file except in compliance with
   * the License.  You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
  * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 
 package org.apache.tomcat.util.modeler;
 
 
 

Internal configuration information for a Notification descriptor.

Author(s):
Craig R. McClanahan
Version:
$Revision: 1237 $ $Date: 2009-11-03 02:55:48 +0100 (Tue, 03 Nov 2009) $
 
 
 public class NotificationInfo extends FeatureInfo implements Serializable {
     static final long serialVersionUID = -6319885418912650856L;
 
     // ----------------------------------------------------- Instance Variables
 

    
The ModelMBeanNotificationInfo object that corresponds to this NotificationInfo instance.
 
     transient MBeanNotificationInfo info = null;
     protected String notifTypes[] = new String[0];
 
     // ------------------------------------------------------------- Properties
 

    
Override the description property setter.

Parameters:
description The new description
 
     public void setDescription(String description) {
         super.setDescription(description);
         this. = null;
     }


    
Override the name property setter.

Parameters:
name The new name
 
     public void setName(String name) {
         super.setName(name);
         this. = null;
     }


    
The set of notification types for this MBean.
 
     public String[] getNotifTypes() {
         return (this.);
     }
 
 
     // --------------------------------------------------------- Public Methods
 

    
Add a new notification type to the set managed by an MBean.

Parameters:
notifType The new notification type
 
     public void addNotifType(String notifType) {
 
         synchronized () {
             String results[] = new String[. + 1];
             System.arraycopy(, 0, results, 0, .);
             results[.] = notifType;
              = results;
             this. = null;
         }
 
     }


    
Create and return a ModelMBeanNotificationInfo object that corresponds to the attribute described by this instance.
        // Return our cached information (if any)
        if ( != null)
            return ();
        // Create and return a new information object
         = new MBeanNotificationInfo
            (getNotifTypes(), getName(), getDescription());
        //Descriptor descriptor = info.getDescriptor();
        //addFields(descriptor);
        //info.setDescriptor(descriptor);
        return ();
    }


    
Return a string representation of this notification descriptor.
    public String toString() {
        StringBuilder sb = new StringBuilder("NotificationInfo[");
        sb.append("name=");
        sb.append();
        sb.append(", description=");
        sb.append();
        sb.append(", notifTypes=");
        sb.append(.);
        sb.append("]");
        return (sb.toString());
    }
New to GrepCode? Check out our FAQ X