/**
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 -
 - JASS: Java Advanced tranSaction Support
 -
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 -
 - This module was originally developed by 
 -
 -    LSD (Distributed Systems Lab, http://lsd.ls.fi.upm.es/lsd/lsd.htm)
 -    at Universidad Politecnica de Madrid (UPM) as an ObjectWeb Consortium
 -    (http://www.objectweb.org) project.
 -
 -    This project has been partially funded by the European Commission under
 -    the IST programme of V FP grant IST-2001-37126 and by the Spanish
 -    Ministry of Science & Technology (MCyT) grants TIC2002-10376-E and
 -    TIC2001-1586-C03-02
 -
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 -  The original code and portions created by LSD are 
 -  Copyright (c) 2004 LSD (UPM)  
 -  All rights reserved.
 -  
 - Redistribution and use in source and binary forms, with or without 
 - modification, are permitted provided that the following conditions are met:
 -
 - -Redistributions of source code must retain the above copyright notice, this
 - list of conditions and the following disclaimer. 
 -
 - -Redistributions in binary form must reproduce the above copyright notice, 
 - this list of conditions and the following disclaimer in the documentation 
 - and/or other materials provided with the distribution. 
 -
 - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
 - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
 - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
 - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
 - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
 - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
 - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
 - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
 - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
 - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
 - POSSIBILITY OF SUCH DAMAGE.
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 -
 -  Author: Francisco Perez Sorrosal (frperezs)
 -
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
*/

package javax.activity;

import javax.activity.coordination.ServiceManager;
import javax.activity.propertygroup.PropertyGroup;

public interface UserActivity {

    public void begin(int timeout)
               throws InvalidStateException,
                      ServiceNotRegisteredException,
                      TimeoutRangeException,
                      SystemException;

    public Outcome complete()
                     throws NoActivityException,
                            ActivityPendingException,
                            ContextPendingException,
                            ServiceNotRegisteredException,
                            NotOriginatorException,
                            ActivityNotProcessedException,
                            SystemException;

    public Outcome completeWithStatus(int completionStatus)
                               throws NoActivityException,
                                      ActivityPendingException,
                                      ContextPendingException,
                                      ServiceNotRegisteredException,
                                      NotOriginatorException,
                                      InvalidStateException,
                                      ActivityNotProcessedException,
                                      SystemException;

    public void setCompletionStatus(int completionStatus)
                             throws NoActivityException,
                                    InvalidStateException,
                                    ServiceNotRegisteredException,
                                    SystemException;

    public int getCompletionStatus()
                            throws ServiceNotRegisteredException,
                                   NoActivityException,
                                   SystemException;

    public int getStatus()
                  throws ServiceNotRegisteredException,
                         SystemException;

    public java.lang.String getName()
                             throws ServiceNotRegisteredException,
                                    SystemException;

    public void setTimeout(int timeout)
                    throws ServiceNotRegisteredException,
                           TimeoutRangeException,
                           SystemException;

    public int getTimeout()
                   throws ServiceNotRegisteredException,
                          SystemException;

    public GlobalId getGlobalId()
                         throws ServiceNotRegisteredException,
                                SystemException;

    public Outcome broadcast(java.lang.String signalSetName)
                      throws NoActivityException,
                             SignalSetUnknownException,
                             ServiceNotRegisteredException,
                             InvalidActivityException,
                             ActivityNotProcessedException,
                             SystemException;

    public ActivityCoordinator getCoordinator()
                                       throws ServiceNotRegisteredException,
                                              NoImplementException,
                                              SystemException;

    public ActivityCoordinator getParentCoordinator()
                                             throws ServiceNotRegisteredException,
                                                    NoImplementException,
                                                    SystemException;

    public PropertyGroup getPropertyGroup(java.lang.String name)
                                   throws PropertyGroupUnknownException,
                                          ServiceNotRegisteredException,
                                          NoActivityException,
                                          SystemException;

    public void registerService(ServiceManager service)
                         throws PropertyGroupUnknownException,
                                ServiceAlreadyRegisteredException,
                                SystemException;

    public ServiceManager getService()
                              throws SystemException;

    public ActivityCoordinator recreate(GlobalId activity,
                                        GlobalId parent,
                                        boolean resume)
                                 throws ServiceNotRegisteredException,
                                        ActivityCompletedException,
                                        java.lang.IllegalArgumentException,
                                        SystemException;

    public GlobalId[] recover()
                       throws ServiceNotRegisteredException,
                              SystemException;

    public void forget(GlobalId globalId)
                throws ServiceNotRegisteredException,
                       SystemException;

}
