Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Copyright (c) 2010-2011. Axon Framework
  *
  * Licensed 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.axonframework.domain;
System events are a special type of application event. They notify the application of a state change of an application component.

In addition to the information provided by the ApplicationEvent, system events also provide information about the exception that caused the event.

Author(s):
Allard Buijze
Since:
0.4
public abstract class SystemEvent extends ApplicationEvent {
    private static final long serialVersionUID = 5636156978533165290L;
    private final Throwable cause;

    
Initialize a system event with the given source, and without an explicit cause.

Parameters:
source The instance that reported this event. May be null.
    protected SystemEvent(Object source) {
        this(sourcenull);
    }

    
Initialize a system event with the given source and cause.

Parameters:
source The instance that reported this event. May be null.
cause The exception that cause this event to be dispatched
    protected SystemEvent(Object sourceThrowable cause) {
        super(source);
        this. = cause;
    }

    
Initializes the event using given parameters. This constructor is intended for the reconstruction of exsisting events (e.g. during deserialization).

Parameters:
identifier The identifier of the event
timestamp The original creation timestamp
eventRevision The revision of the event type
sourceDescription The description of the source. If null, will default to "[unknown source]".
cause The cause exception if this event represents an error
    protected SystemEvent(String identifierDateTime timestamplong eventRevisionString sourceDescription,
                          Throwable cause) {
        super(identifiertimestampeventRevisionsourceDescription);
        this. = cause;
    }

    
Initializes the event using given parameters. This constructor is intended for the reconstruction of exsisting events (e.g. during deserialization).

Parameters:
identifier The identifier of the event
timestamp The original creation timestamp
eventRevision The revision of the event type
sourceDescription The description of the source. If null, will default to "[unknown source]".
    protected SystemEvent(String identifierDateTime timestamplong eventRevisionString sourceDescription) {
        this(identifiertimestampeventRevisionsourceDescriptionnull);
    }

    
Returns the cause that was attached to this event. Can return null.

Returns:
the cause that was attached to this event. Can return null.
    public Throwable getCause() {
        return ;
    }
New to GrepCode? Check out our FAQ X