Logo
Distributed Genetic Programming Framework
print print

File org.dgpf.search.api.cs.events.SearchServerAdaptionEvent.java

Here you can find all the information about the file org.dgpf.search.api.cs.events.SearchServerAdaptionEvent.java. You may explore it here or download it onto your local disk.
/*
 * Copyright (c) 2006 Thomas Weise
 * 
 * E-Mail           : tweise@gmx.de
 * Creation Date    : 2006-04-12 12:00:09
 * Original Filename: org.dgpf.search.api.cs.events.SearchServerAdaptionEvent.java
 * Version          : 2.0.2
 * Last modification: 2006-05-29
 *                by: Thomas Weise
 * 
 * License          : GNU LESSER GENERAL PUBLIC LICENSE
 *                    Version 2.1, February 1999
 *                    You should have received a copy of this license along
 *                    with this library; if not, write to the Free Software
 *                    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 *                    MA 02111-1307, USA or download the license under
 *                    http://www.gnu.org/copyleft/lesser.html.
 *                    
 * Warranty         : This software is provided "as is" without any
 *                    warranty; without even the implied warranty of
 *                    merchantability or fitness for a particular purpose.
 *                    See the Gnu Lesser General Public License for more
 *                    details.
 */

 
package org.dgpf.search.api.cs.events;

import org.dgpf.search.api.SearchUtils;
import org.dgpf.search.api.cs.SearchServer;
import org.sfc.meta.BoundedLongProperty;
import org.sfc.meta.MetaInformation;
import org.sfc.meta.Property;
import org.sfc.meta.TimeProperty;

/**
 * This event is thrown whenever a search server is updated.
 *
 * @author Thomas Weise
 */

public final  class SearchServerAdaptionEvent  extends SearchServerEvent
  {
/**
 * The serial version uid.
 */

  private static final long serialVersionUID = 1;
  
/**
 * The meta information ofsearch server adaption events.
 */

  public  static  final MetaInformation SEARCH_SERVER_ADAPTATION_METAINFO ;
    
/**
 * The property for the time since the last adaptation.
 */

  public  static  final TimeProperty            ADAPTION_TIME  ;
/**
 * The property for the count of adaptations performed.
 */

  public  static  final BoundedLongProperty     ADAPTION_COUNT ;    
/**
 * The property for the currently done tasks.
 */

  public  static  final BoundedLongProperty     CURRENT_TASKS;  
/**
 * The property for the update data information.
 */

  public  static  final Property<Object>        DATA  ;    
  
  static
    {
    ADAPTION_TIME =
      new TimeProperty("adaption_time",
                       SearchUtils.PERFORMANCE_PROPERTIES,
                       0, Long.MAX_VALUE, true);
    ADAPTION_TIME.add_port(SearchServerAdaptionEvent.class,
                           true, false, null);

    ADAPTION_COUNT  =
      new BoundedLongProperty("adaption_count",
                       SearchUtils.PERFORMANCE_PROPERTIES,
                       0, Long.MAX_VALUE);
    ADAPTION_COUNT.add_port(SearchServerAdaptionEvent.class,
                           true, false, null);
  
    CURRENT_TASKS  =
      new BoundedLongProperty("current_tasks",
                         SearchUtils.PERFORMANCE_PROPERTIES,
                         0, Long.MAX_VALUE);
    CURRENT_TASKS.add_port(SearchServerAdaptionEvent.class,
                           true, false, null);
  
    DATA  = new Property<Object>("data",
                         SearchUtils.PERFORMANCE_PROPERTIES,
                         Object.class);
    DATA.add_port(SearchServerAdaptionEvent.class,
                           true, false, null);
    
    SearchUtils.START_TIME.add_port(SearchServerAdaptionEvent.class,
                           true, false, null);
    SearchUtils.TASK_COUNT.add_port(SearchServerAdaptionEvent.class,
                           "get_total_tasks", null, null);
    SearchUtils.TOTAL_TIME.add_port(SearchServerAdaptionEvent.class,
                           true, false, null);
  
    SEARCH_SERVER_ADAPTATION_METAINFO = new MetaInformation();
    }
  
/**
 * The total count of tasks processed by the server.
 */

  private final long    m_task_count  ;
/**
 * The count of tasks processed since the last adaption.
 */

  private final long    m_current_tasks ;
/**
 * The start time when the server started running.
 */

  private final long    m_start_time  ;
/**
 * The total time the server is currently running.
 */

  private final long    m_total_time  ;
/**
 * The time since the last adaption.
 */

  private final long    m_adaption_time  ;
/**
 * The count of adaptations performed.
 */

  private final long    m_adaptation_count;
/**
 * The data we adapt to.
 */

  private final Object  m_data  ;
  
/**
 * Create a new <code>SearchServerEvent</code>. You cannot do this directly,
 * but can create derived class instances.
 * @param p_source          The source of the event.
 * @param p_task_count      The total count of tasks processed by the server.
 * @param p_current_tasks   The count of tasks processed since the last
 *                          adaption.
 * @param p_start_time      The start time when the server started running.
 * @param p_total_time      The total time the server is currently running.
 * @param p_adaption_time   The time since the last adaption.
 * @param p_adaptation_count  The count of adaptations in total performed.
 * @param p_data            The data we adapt to.
 */

  public    SearchServerAdaptionEvent(final SearchServer  p_source,
                                      final long          p_task_count ,
                                      final long          p_current_tasks,
                                      final long          p_start_time,
                                      final long          p_total_time,
                                      final long          p_adaption_time,
                                      final long          p_adaptation_count,
                                      final Object        p_data  )
    {
    super(p_source);
    
    this.m_task_count       = p_task_count;
    this.m_current_tasks    = p_current_tasks;
    this.m_start_time       = p_start_time;
    this.m_total_time       = p_total_time;
    this.m_adaption_time    = p_adaption_time;
    this.m_data             = p_data;
    this.m_adaptation_count = p_adaptation_count;
    }

/**
 * Obtain the total count of tasks processed by the server.
 * @return The total count of tasks processed by the server.
 */

  public  final long  get_total_tasks()
    {
    return this.m_task_count;
    }
  
/**
 * Obtain the count of tasks processed since the last adaption.
 * @return The count of tasks processed since the last adaption.
 */

  public  final long  get_current_tasks()
    {
    return this.m_current_tasks;
    }
  
/**
 * Obtain the start time when the server started running.
 * @return The start time when the server started running.
 */

  public  final long  get_start_time()
    {
    return this.m_start_time;
    }
/**
 * Obtain the total time the server is currently running.
 * @return The total time the server is currently running.
 */

  public  final long  get_total_time  ()
    {
    return this.m_total_time;
    }
  
/**
 * Obtain the time since the last adaption.
 * @return The time since the last adaption.
 */

  public  final long  get_adaption_time()
    {
    return this.m_adaption_time;
    }

/**
 * Obtain the data we adapted to.
 * @return The data we adapted to.
 */

  public  final Object  get_data()
    {
    return this.m_data;
    }
  
/**
 * Obtain the count of adaptations performed in total.
 * @return The count of adaptations performed in total.
 */

  public  final long    get_adaption_count()
    {
    return this.m_adaptation_count;
    }
  }

File Information:

file name:SearchServerAdaptionEvent.java
package:org.dgpf.search.api.cs.events
qualified name:org.dgpf.search.api.cs.events.SearchServerAdaptionEvent.java
file type:Java Source File
download location:download http://dgpf.sourceforge.net/source/org/dgpf/search/api/cs/events/SearchServerAdaptionEvent.java
size:7.583 KB (7766 B)
uploaded: 2015-07-22 04:11:00 GMT+0000
last update: 2006-05-29 14:14:30 GMT+0000
last access: 2017-11-18 06:27:18 GMT+0000

statistics online since 2006-01-02.   RSS Feed
Contact us by sending an email to tweise@gmx.de to receive further information, to report errors, or to join our project.
All content on this site (http://dgpf.sourceforge.net/) is LGPL-licensed.
http://dgpf.sourceforge.net/scripts/source/source.php last modified at 2015-07-22 04:10:53 GMT+0000 served at 2017-11-18 06:27:18 GMT+0000.
Valid CSS Valid XHTML 1.1
Valid RSS SourceForge.net Logo