Package org.jboss.wsf.framework.management.recording

Source Code of org.jboss.wsf.framework.management.recording.RecordFactory

/*
* JBoss, Home of Professional Open Source
* Copyright 2005, JBoss Inc., and individual contributors as indicated
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but 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.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jboss.wsf.framework.management.recording;

//$Id: RecordFactory.java 5380 2007-12-20 18:38:09Z alessio.soldano@jboss.com $

import org.jboss.wsf.spi.management.recording.Record;

/**
* Simple record factory
*
* @author alessio.soldano@jboss.com
* @since 8-Dec-2007
*/
public class RecordFactory
{
   private static long count = 0;
  
   public static String newGroupID()
   {
      long time = System.currentTimeMillis();
      StringBuilder sb = new StringBuilder();
      synchronized (RecordFactory.class)
      {
         count++;
      }
      sb.append(count);
      sb.append("-");
      sb.append(time);
      return sb.toString();
   }
  
   public static Record newRecord(String groupID)
   {
      Record record = new RecordImpl();
      record.setGroupID(groupID);
      return record;
   }
  
   public static Record newRecord()
   {
      return newRecord(newGroupID());
   }
}
TOP

Related Classes of org.jboss.wsf.framework.management.recording.RecordFactory

TOP
Copyright © 2018 www.massapi.com. 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.