001/* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.apache.commons.scxml2.system; 018 019import java.io.Serializable; 020 021/** 022 * Event system variable holding a structure containing the current event's name and any data contained in the event 023 */ 024public class EventVariable implements Serializable { 025 026 /** 027 * Serial version UID. 028 */ 029 private static final long serialVersionUID = 1L; 030 031 public static final String TYPE_PLATFORM = "platform"; 032 public static final String TYPE_INTERNAL = "internal"; 033 public static final String TYPE_EXTERNAL = "external"; 034 035 /** 036 * The name of the event. 037 */ 038 private final String name; 039 040 /** 041 * The event type 042 */ 043 private final String type; 044 045 /** 046 * The sendid in case the sending entity has specified a value for this. 047 */ 048 private final String sendid; 049 050 /** 051 * The URI string of the originating entity in an external event. 052 */ 053 private final String origin; 054 055 /** 056 * The type in an external event. 057 */ 058 private final String origintype; 059 060 /** 061 * The invoke id of the invocation that triggered the child process. 062 */ 063 private final String invokeid; 064 065 /** 066 * Whatever data the sending entity chose to include in the event 067 */ 068 private final Object data; 069 070 public EventVariable(final String name, final String type, final String sendid, final String origin, final String origintype, final String invokeid, final Object data) { 071 this.name = name; 072 this.type = type; 073 this.sendid = sendid; 074 this.origin = origin; 075 this.origintype = origintype; 076 this.invokeid = invokeid; 077 this.data = data; 078 } 079 080 public String getName() { 081 return name; 082 } 083 084 public String getType() { 085 return type; 086 } 087 088 public String getSendid() { 089 return sendid; 090 } 091 092 public String getOrigin() { 093 return origin; 094 } 095 096 public String getOrigintype() { 097 return origintype; 098 } 099 100 public String getInvokeid() { 101 return invokeid; 102 } 103 104 public Object getData() { 105 return data; 106 } 107} 108