You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rh...@apache.org on 2014/07/17 21:51:25 UTC
svn commit: r1611449 - in /qpid/proton/trunk: proton-c/bindings/python/
proton-c/include/proton/ proton-c/src/engine/ proton-c/src/messenger/
proton-c/src/transport/ proton-j/src/main/java/org/apache/qpid/proton/engine/
proton-j/src/main/java/org/apach...
Author: rhs
Date: Thu Jul 17 19:51:24 2014
New Revision: 1611449
URL: http://svn.apache.org/r1611449
Log:
made event categories map one to one to context type; split local/remote state events into distinct open/close and remote_open/remote_close events
Modified:
qpid/proton/trunk/proton-c/bindings/python/proton.py
qpid/proton/trunk/proton-c/include/proton/event.h
qpid/proton/trunk/proton-c/include/proton/terminus.h
qpid/proton/trunk/proton-c/src/engine/engine.c
qpid/proton/trunk/proton-c/src/engine/event.c
qpid/proton/trunk/proton-c/src/messenger/messenger.c
qpid/proton/trunk/proton-c/src/transport/transport.c
qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/Event.java
qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/ConnectionImpl.java
qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/EndpointImpl.java
qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/EventImpl.java
qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/LinkImpl.java
qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/SessionImpl.java
qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java
qpid/proton/trunk/proton-j/src/main/resources/cengine.py
qpid/proton/trunk/tests/python/proton_tests/engine.py
Modified: qpid/proton/trunk/proton-c/bindings/python/proton.py
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/bindings/python/proton.py?rev=1611449&r1=1611448&r2=1611449&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/bindings/python/proton.py (original)
+++ qpid/proton/trunk/proton-c/bindings/python/proton.py Thu Jul 17 19:51:24 2014
@@ -3339,21 +3339,34 @@ class Collector:
class Event:
- CATEGORY_PROTOCOL = PN_EVENT_CATEGORY_PROTOCOL
+ CATEGORY_CONNECTION = PN_EVENT_CATEGORY_CONNECTION
+ CATEGORY_SESSION = PN_EVENT_CATEGORY_SESSION
+ CATEGORY_LINK = PN_EVENT_CATEGORY_LINK
+ CATEGORY_DELIVERY = PN_EVENT_CATEGORY_DELIVERY
+ CATEGORY_TRANSPORT = PN_EVENT_CATEGORY_TRANSPORT
CONNECTION_INIT = PN_CONNECTION_INIT
- CONNECTION_LOCAL_STATE = PN_CONNECTION_LOCAL_STATE
- CONNECTION_REMOTE_STATE = PN_CONNECTION_REMOTE_STATE
+ CONNECTION_OPEN = PN_CONNECTION_OPEN
+ CONNECTION_CLOSE = PN_CONNECTION_CLOSE
+ CONNECTION_REMOTE_OPEN = PN_CONNECTION_REMOTE_OPEN
+ CONNECTION_REMOTE_CLOSE = PN_CONNECTION_REMOTE_CLOSE
CONNECTION_FINAL = PN_CONNECTION_FINAL
+
SESSION_INIT = PN_SESSION_INIT
- SESSION_LOCAL_STATE = PN_SESSION_LOCAL_STATE
- SESSION_REMOTE_STATE = PN_SESSION_REMOTE_STATE
+ SESSION_OPEN = PN_SESSION_OPEN
+ SESSION_CLOSE = PN_SESSION_CLOSE
+ SESSION_REMOTE_OPEN = PN_SESSION_REMOTE_OPEN
+ SESSION_REMOTE_CLOSE = PN_SESSION_REMOTE_CLOSE
SESSION_FINAL = PN_SESSION_FINAL
+
LINK_INIT = PN_LINK_INIT
- LINK_LOCAL_STATE = PN_LINK_LOCAL_STATE
- LINK_REMOTE_STATE = PN_LINK_REMOTE_STATE
+ LINK_OPEN = PN_LINK_OPEN
+ LINK_CLOSE = PN_LINK_CLOSE
+ LINK_REMOTE_OPEN = PN_LINK_REMOTE_OPEN
+ LINK_REMOTE_CLOSE = PN_LINK_REMOTE_CLOSE
LINK_FLOW = PN_LINK_FLOW
LINK_FINAL = PN_LINK_FINAL
+
DELIVERY = PN_DELIVERY
TRANSPORT = PN_TRANSPORT
Modified: qpid/proton/trunk/proton-c/include/proton/event.h
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/include/proton/event.h?rev=1611449&r1=1611448&r2=1611449&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/include/proton/event.h (original)
+++ qpid/proton/trunk/proton-c/include/proton/event.h Thu Jul 17 19:51:24 2014
@@ -81,8 +81,12 @@ typedef struct pn_event_t pn_event_t;
*/
typedef enum {
PN_EVENT_CATEGORY_NONE = 0,
- PN_EVENT_CATEGORY_PROTOCOL = 0x00010000,
- PN_EVENT_CATEGORY_COUNT = 2
+ PN_EVENT_CATEGORY_CONNECTION = 0x00010000,
+ PN_EVENT_CATEGORY_SESSION = 0x00020000,
+ PN_EVENT_CATEGORY_LINK = 0x00030000,
+ PN_EVENT_CATEGORY_DELIVERY = 0x00040000,
+ PN_EVENT_CATEGORY_TRANSPORT = 0x00050000,
+ PN_EVENT_CATEGORY_COUNT = 6
} pn_event_category_t;
/**
@@ -94,84 +98,136 @@ typedef enum {
* ever be generated.
*/
PN_EVENT_NONE = 0,
+
/**
- * The endpoint state flags for a connection have changed. Events of
- * this type point to the relevant connection as well as its
- * associated transport.
- */
- PN_CONNECTION_REMOTE_STATE = PN_EVENT_CATEGORY_PROTOCOL+1,
- PN_CONNECTION_LOCAL_STATE = PN_EVENT_CATEGORY_PROTOCOL+2,
- /**
- * The endpoint state flags for a session have changed. Events of
- * this type point to the relevant session as well as its associated
- * connection and transport.
- */
- PN_SESSION_REMOTE_STATE = PN_EVENT_CATEGORY_PROTOCOL+3,
- PN_SESSION_LOCAL_STATE = PN_EVENT_CATEGORY_PROTOCOL+4,
- /**
- * The endpoint state flags for a link have changed. Events of this
- * type point to the relevant link as well as its associated
- * session, connection, and transport.
+ * The connection has been created. This is the first event that
+ * will ever be issued for a connection. Events of this type point
+ * to the relevant connection.
*/
- PN_LINK_REMOTE_STATE = PN_EVENT_CATEGORY_PROTOCOL+5,
- PN_LINK_LOCAL_STATE = PN_EVENT_CATEGORY_PROTOCOL+6,
+ PN_CONNECTION_INIT = PN_EVENT_CATEGORY_CONNECTION + 1,
+
/**
- * The flow control state for a link has changed. Events of this
- * type point to the relevant link along with its associated
- * session, connection, and transport.
+ * The local connection endpoint has been closed. Events of this
+ * type point to the relevant connection.
*/
- PN_LINK_FLOW = PN_EVENT_CATEGORY_PROTOCOL+7,
+ PN_CONNECTION_OPEN = PN_EVENT_CATEGORY_CONNECTION + 2,
+
/**
- * A delivery has been created or updated. Events of this type point
- * to the relevant delivery as well as its associated link, session,
- * connection, and transport.
+ * The remote endpoint has opened the connection. Events of this
+ * type point to the relevant connection.
*/
- PN_DELIVERY = PN_EVENT_CATEGORY_PROTOCOL+8,
+ PN_CONNECTION_REMOTE_OPEN = PN_EVENT_CATEGORY_CONNECTION + 3,
+
/**
- * The transport has new data to read and/or write. Events of this
- * type point to the relevant transport as well as its associated
- * connection.
+ * The local connection endpoint has been closed. Events of this
+ * type point to the relevant connection.
*/
- PN_TRANSPORT = PN_EVENT_CATEGORY_PROTOCOL+9,
+ PN_CONNECTION_CLOSE = PN_EVENT_CATEGORY_CONNECTION + 4,
+
+ /**
+ * The remote endpoint has closed the connection. Events of this
+ * type point to the relevant connection.
+ */
+ PN_CONNECTION_REMOTE_CLOSE = PN_EVENT_CATEGORY_CONNECTION + 5,
/**
* The connection has been freed and any outstanding processing has
* been completed. This is the final event that will ever be issued
* for a connection.
*/
- PN_CONNECTION_FINAL = PN_EVENT_CATEGORY_PROTOCOL+10,
+ PN_CONNECTION_FINAL = PN_EVENT_CATEGORY_CONNECTION + 6,
+
+ /**
+ * The session has been created. This is the first event that will
+ * ever be issued for a session.
+ */
+ PN_SESSION_INIT = PN_EVENT_CATEGORY_SESSION + 1,
+
+ /**
+ * The local session endpoint has been opened. Events of this type
+ * point ot the relevant session.
+ */
+ PN_SESSION_OPEN = PN_EVENT_CATEGORY_SESSION + 2,
+
+ /**
+ * The remote endpoint has opened the session. Events of this type
+ * point to the relevant session.
+ */
+ PN_SESSION_REMOTE_OPEN = PN_EVENT_CATEGORY_SESSION + 3,
+
+ /**
+ * The local session endpoint has been closed. Events of this type
+ * point ot the relevant session.
+ */
+ PN_SESSION_CLOSE = PN_EVENT_CATEGORY_SESSION + 4,
+
+ /**
+ * The remote endpoint has closed the session. Events of this type
+ * point to the relevant session.
+ */
+ PN_SESSION_REMOTE_CLOSE = PN_EVENT_CATEGORY_SESSION + 5,
/**
* The session has been freed and any outstanding processing has
* been completed. This is the final event that will ever be issued
* for a session.
*/
- PN_SESSION_FINAL = PN_EVENT_CATEGORY_PROTOCOL+11,
+ PN_SESSION_FINAL = PN_EVENT_CATEGORY_SESSION + 6,
/**
- * The link has been freed and any outstanding processing has been
- * completed. This is the final event that will ever be issued for a
- * link.
+ * The link has been created. This is the first event that will ever
+ * be issued for a link.
*/
- PN_LINK_FINAL = PN_EVENT_CATEGORY_PROTOCOL+12,
+ PN_LINK_INIT = PN_EVENT_CATEGORY_LINK + 1,
/**
- * The connection has been created. This is the first event that
- * will ever be issued for a connection.
+ * The local link endpoint has been opened. Events of this type
+ * point ot the relevant link.
*/
- PN_CONNECTION_INIT = PN_EVENT_CATEGORY_PROTOCOL+13,
+ PN_LINK_OPEN = PN_EVENT_CATEGORY_LINK + 2,
/**
- * The session has been created. This is the first event that will
- * ever be issued for a session.
+ * The remote endpoint has opened the link. Events of this type
+ * point to the relevant link.
*/
- PN_SESSION_INIT = PN_EVENT_CATEGORY_PROTOCOL+14,
+ PN_LINK_REMOTE_OPEN = PN_EVENT_CATEGORY_LINK + 3,
/**
- * The link has been created. This is the first event that will ever
- * be issued for a link.
+ * The local link endpoint has been closed. Events of this type
+ * point ot the relevant link.
+ */
+ PN_LINK_CLOSE = PN_EVENT_CATEGORY_LINK + 4,
+
+ /**
+ * The remote endpoint has closed the link. Events of this type
+ * point to the relevant link.
+ */
+ PN_LINK_REMOTE_CLOSE = PN_EVENT_CATEGORY_LINK + 5,
+
+ /**
+ * The flow control state for a link has changed. Events of this
+ * type point to the relevant link.
+ */
+ PN_LINK_FLOW = PN_EVENT_CATEGORY_LINK + 6,
+
+ /**
+ * The link has been freed and any outstanding processing has been
+ * completed. This is the final event that will ever be issued for a
+ * link. Events of this type point to the relevant link.
+ */
+ PN_LINK_FINAL = PN_EVENT_CATEGORY_LINK + 7,
+
+ /**
+ * A delivery has been created or updated. Events of this type point
+ * to the relevant delivery.
+ */
+ PN_DELIVERY = PN_EVENT_CATEGORY_DELIVERY + 1,
+
+ /**
+ * The transport has new data to read and/or write. Events of this
+ * type point to the relevant transport.
*/
- PN_LINK_INIT = PN_EVENT_CATEGORY_PROTOCOL+15
+ PN_TRANSPORT = PN_EVENT_CATEGORY_TRANSPORT + 1,
} pn_event_type_t;
Modified: qpid/proton/trunk/proton-c/include/proton/terminus.h
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/include/proton/terminus.h?rev=1611449&r1=1611448&r2=1611449&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/include/proton/terminus.h (original)
+++ qpid/proton/trunk/proton-c/include/proton/terminus.h Thu Jul 17 19:51:24 2014
@@ -90,10 +90,10 @@ typedef enum {
* counting down.
*/
typedef enum {
- PN_LINK_CLOSE, /**< the terminus is orphaned when the parent link is closed */
- PN_SESSION_CLOSE, /**< the terminus is orphaned when the parent session is closed */
- PN_CONNECTION_CLOSE, /**< the terminus is orphaned when the parent connection is closed */
- PN_NEVER /**< the terminus is never considered orphaned */
+ PN_EXPIRE_WITH_LINK, /**< the terminus is orphaned when the parent link is closed */
+ PN_EXPIRE_WITH_SESSION, /**< the terminus is orphaned when the parent session is closed */
+ PN_EXPIRE_WITH_CONNECTION, /**< the terminus is orphaned when the parent connection is closed */
+ PN_EXPIRE_NEVER /**< the terminus is never considered orphaned */
} pn_expiry_policy_t;
/**
Modified: qpid/proton/trunk/proton-c/src/engine/engine.c
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/src/engine/engine.c?rev=1611449&r1=1611448&r2=1611449&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/src/engine/engine.c (original)
+++ qpid/proton/trunk/proton-c/src/engine/engine.c Thu Jul 17 19:51:24 2014
@@ -52,19 +52,27 @@ pn_connection_t *pn_ep_get_connection(pn
return NULL;
}
-/* map the endpoint type to its local event type */
-static const pn_event_type_t endpoint_event_map[] = {
- PN_CONNECTION_LOCAL_STATE, /* CONNECTION */
- PN_SESSION_LOCAL_STATE, /* SESSION */
- PN_LINK_LOCAL_STATE, /* SENDER */
- PN_LINK_LOCAL_STATE}; /* RECEIVER */
+static pn_event_type_t endpoint_event(pn_endpoint_type_t type, bool open) {
+ switch (type) {
+ case CONNECTION:
+ return open ? PN_CONNECTION_OPEN : PN_CONNECTION_CLOSE;
+ case SESSION:
+ return open ? PN_SESSION_OPEN : PN_SESSION_CLOSE;
+ case SENDER:
+ case RECEIVER:
+ return open ? PN_LINK_OPEN : PN_LINK_CLOSE;
+ default:
+ assert(false);
+ return PN_EVENT_NONE;
+ }
+}
static void pn_endpoint_open(pn_endpoint_t *endpoint)
{
// TODO: do we care about the current state?
PN_SET_LOCAL(endpoint->state, PN_LOCAL_ACTIVE);
pn_connection_t *conn = pn_ep_get_connection(endpoint);
- pn_collector_put(conn->collector, endpoint_event_map[endpoint->type],
+ pn_collector_put(conn->collector, endpoint_event(endpoint->type, true),
endpoint);
pn_modified(conn, endpoint, true);
}
@@ -74,7 +82,7 @@ static void pn_endpoint_close(pn_endpoin
// TODO: do we care about the current state?
PN_SET_LOCAL(endpoint->state, PN_LOCAL_CLOSED);
pn_connection_t *conn = pn_ep_get_connection(endpoint);
- pn_collector_put(conn->collector, endpoint_event_map[endpoint->type],
+ pn_collector_put(conn->collector, endpoint_event(endpoint->type, false),
endpoint);
pn_modified(conn, endpoint, true);
}
@@ -783,7 +791,7 @@ void pn_terminus_init(pn_terminus_t *ter
terminus->type = type;
terminus->address = pn_string(NULL);
terminus->durability = PN_NONDURABLE;
- terminus->expiry_policy = PN_SESSION_CLOSE;
+ terminus->expiry_policy = PN_EXPIRE_WITH_SESSION;
terminus->timeout = 0;
terminus->dynamic = false;
terminus->distribution_mode = PN_DIST_MODE_UNSPECIFIED;
Modified: qpid/proton/trunk/proton-c/src/engine/event.c
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/src/engine/event.c?rev=1611449&r1=1611448&r2=1611449&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/src/engine/event.c (original)
+++ qpid/proton/trunk/proton-c/src/engine/event.c Thu Jul 17 19:51:24 2014
@@ -204,13 +204,10 @@ pn_connection_t *pn_event_connection(pn_
pn_session_t *ssn;
pn_transport_t *transport;
- switch (pn_event_type(event)) {
- case PN_CONNECTION_REMOTE_STATE:
- case PN_CONNECTION_LOCAL_STATE:
- case PN_CONNECTION_FINAL:
- case PN_CONNECTION_INIT:
+ switch (pn_event_category(event)) {
+ case PN_EVENT_CATEGORY_CONNECTION:
return (pn_connection_t *)event->context;
- case PN_TRANSPORT:
+ case PN_EVENT_CATEGORY_TRANSPORT:
transport = pn_event_transport(event);
if (transport)
return transport->connection;
@@ -226,11 +223,8 @@ pn_connection_t *pn_event_connection(pn_
pn_session_t *pn_event_session(pn_event_t *event)
{
pn_link_t *link;
- switch (pn_event_type(event)) {
- case PN_SESSION_REMOTE_STATE:
- case PN_SESSION_LOCAL_STATE:
- case PN_SESSION_FINAL:
- case PN_SESSION_INIT:
+ switch (pn_event_category(event)) {
+ case PN_EVENT_CATEGORY_SESSION:
return (pn_session_t *)event->context;
default:
link = pn_event_link(event);
@@ -243,12 +237,8 @@ pn_session_t *pn_event_session(pn_event_
pn_link_t *pn_event_link(pn_event_t *event)
{
pn_delivery_t *dlv;
- switch (pn_event_type(event)) {
- case PN_LINK_REMOTE_STATE:
- case PN_LINK_LOCAL_STATE:
- case PN_LINK_FLOW:
- case PN_LINK_FINAL:
- case PN_LINK_INIT:
+ switch (pn_event_category(event)) {
+ case PN_EVENT_CATEGORY_LINK:
return (pn_link_t *)event->context;
default:
dlv = pn_event_delivery(event);
@@ -260,19 +250,27 @@ pn_link_t *pn_event_link(pn_event_t *eve
pn_delivery_t *pn_event_delivery(pn_event_t *event)
{
- if (pn_event_type(event) == PN_DELIVERY)
+ switch (pn_event_category(event)) {
+ case PN_EVENT_CATEGORY_DELIVERY:
return (pn_delivery_t *)event->context;
- return NULL;
+ default:
+ return NULL;
+ }
}
pn_transport_t *pn_event_transport(pn_event_t *event)
{
- if (pn_event_type(event) == PN_TRANSPORT)
+ switch (pn_event_category(event)) {
+ case PN_EVENT_CATEGORY_TRANSPORT:
return (pn_transport_t *)event->context;
- pn_connection_t *conn = pn_event_connection(event);
- if (conn)
- return pn_connection_transport(conn);
- return NULL;
+ default:
+ {
+ pn_connection_t *conn = pn_event_connection(event);
+ if (conn)
+ return pn_connection_transport(conn);
+ return NULL;
+ }
+ }
}
const char *pn_event_type_name(pn_event_type_t type)
@@ -282,26 +280,38 @@ const char *pn_event_type_name(pn_event_
return "PN_EVENT_NONE";
case PN_CONNECTION_INIT:
return "PN_CONNECTION_INIT";
- case PN_CONNECTION_REMOTE_STATE:
- return "PN_CONNECTION_REMOTE_STATE";
- case PN_CONNECTION_LOCAL_STATE:
- return "PN_CONNECTION_LOCAL_STATE";
+ case PN_CONNECTION_REMOTE_OPEN:
+ return "PN_CONNECTION_REMOTE_OPEN";
+ case PN_CONNECTION_OPEN:
+ return "PN_CONNECTION_OPEN";
+ case PN_CONNECTION_REMOTE_CLOSE:
+ return "PN_CONNECTION_REMOTE_CLOSE";
+ case PN_CONNECTION_CLOSE:
+ return "PN_CONNECTION_CLOSE";
case PN_CONNECTION_FINAL:
return "PN_CONNECTION_FINAL";
case PN_SESSION_INIT:
return "PN_SESSION_INIT";
- case PN_SESSION_REMOTE_STATE:
- return "PN_SESSION_REMOTE_STATE";
- case PN_SESSION_LOCAL_STATE:
- return "PN_SESSION_LOCAL_STATE";
+ case PN_SESSION_REMOTE_OPEN:
+ return "PN_SESSION_REMOTE_OPEN";
+ case PN_SESSION_OPEN:
+ return "PN_SESSION_OPEN";
+ case PN_SESSION_REMOTE_CLOSE:
+ return "PN_SESSION_REMOTE_CLOSE";
+ case PN_SESSION_CLOSE:
+ return "PN_SESSION_CLOSE";
case PN_SESSION_FINAL:
return "PN_SESSION_FINAL";
case PN_LINK_INIT:
return "PN_LINK_INIT";
- case PN_LINK_REMOTE_STATE:
- return "PN_LINK_REMOTE_STATE";
- case PN_LINK_LOCAL_STATE:
- return "PN_LINK_LOCAL_STATE";
+ case PN_LINK_REMOTE_OPEN:
+ return "PN_LINK_REMOTE_OPEN";
+ case PN_LINK_OPEN:
+ return "PN_LINK_OPEN";
+ case PN_LINK_REMOTE_CLOSE:
+ return "PN_LINK_REMOTE_CLOSE";
+ case PN_LINK_CLOSE:
+ return "PN_LINK_CLOSE";
case PN_LINK_FLOW:
return "PN_LINK_FLOW";
case PN_LINK_FINAL:
Modified: qpid/proton/trunk/proton-c/src/messenger/messenger.c
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/src/messenger/messenger.c?rev=1611449&r1=1611448&r2=1611449&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/src/messenger/messenger.c (original)
+++ qpid/proton/trunk/proton-c/src/messenger/messenger.c Thu Jul 17 19:51:24 2014
@@ -1233,16 +1233,22 @@ int pn_messenger_process_events(pn_messe
case PN_LINK_INIT:
//printf("link created: %p\n", (void *) pn_event_link(event));
break;
- case PN_CONNECTION_REMOTE_STATE:
- case PN_CONNECTION_LOCAL_STATE:
+ case PN_CONNECTION_REMOTE_OPEN:
+ case PN_CONNECTION_REMOTE_CLOSE:
+ case PN_CONNECTION_OPEN:
+ case PN_CONNECTION_CLOSE:
pn_messenger_process_connection(messenger, event);
break;
- case PN_SESSION_REMOTE_STATE:
- case PN_SESSION_LOCAL_STATE:
+ case PN_SESSION_REMOTE_OPEN:
+ case PN_SESSION_REMOTE_CLOSE:
+ case PN_SESSION_OPEN:
+ case PN_SESSION_CLOSE:
pn_messenger_process_session(messenger, event);
break;
- case PN_LINK_REMOTE_STATE:
- case PN_LINK_LOCAL_STATE:
+ case PN_LINK_REMOTE_OPEN:
+ case PN_LINK_REMOTE_CLOSE:
+ case PN_LINK_OPEN:
+ case PN_LINK_CLOSE:
pn_messenger_process_link(messenger, event);
break;
case PN_LINK_FLOW:
Modified: qpid/proton/trunk/proton-c/src/transport/transport.c
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/src/transport/transport.c?rev=1611449&r1=1611448&r2=1611449&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/src/transport/transport.c (original)
+++ qpid/proton/trunk/proton-c/src/transport/transport.c Thu Jul 17 19:51:24 2014
@@ -265,7 +265,7 @@ int pn_transport_bind(pn_transport_t *tr
pn_incref2(connection, transport);
if (transport->open_rcvd) {
PN_SET_REMOTE(connection->endpoint.state, PN_REMOTE_ACTIVE);
- pn_collector_put(connection->collector, PN_CONNECTION_REMOTE_STATE, connection);
+ pn_collector_put(connection->collector, PN_CONNECTION_REMOTE_OPEN, connection);
if (!pn_error_code(transport->error)) {
transport->disp->halt = false;
transport_consume(transport); // blech - testBindAfterOpen
@@ -473,7 +473,7 @@ int pn_do_open(pn_dispatcher_t *disp)
if (conn) {
PN_SET_REMOTE(conn->endpoint.state, PN_REMOTE_ACTIVE);
- pn_collector_put(conn->collector, PN_CONNECTION_REMOTE_STATE, conn);
+ pn_collector_put(conn->collector, PN_CONNECTION_REMOTE_OPEN, conn);
} else {
transport->disp->halt = true;
}
@@ -502,7 +502,7 @@ int pn_do_begin(pn_dispatcher_t *disp)
ssn->state.incoming_transfer_count = next;
pn_map_channel(transport, disp->channel, ssn);
PN_SET_REMOTE(ssn->endpoint.state, PN_REMOTE_ACTIVE);
- pn_collector_put(transport->connection->collector, PN_SESSION_REMOTE_STATE, ssn);
+ pn_collector_put(transport->connection->collector, PN_SESSION_REMOTE_OPEN, ssn);
return 0;
}
@@ -525,18 +525,18 @@ pn_link_t *pn_find_link(pn_session_t *ss
static pn_expiry_policy_t symbol2policy(pn_bytes_t symbol)
{
if (!symbol.start)
- return PN_SESSION_CLOSE;
+ return PN_EXPIRE_WITH_SESSION;
if (!strncmp(symbol.start, "link-detach", symbol.size))
- return PN_LINK_CLOSE;
+ return PN_EXPIRE_WITH_LINK;
if (!strncmp(symbol.start, "session-end", symbol.size))
- return PN_SESSION_CLOSE;
+ return PN_EXPIRE_WITH_SESSION;
if (!strncmp(symbol.start, "connection-close", symbol.size))
- return PN_CONNECTION_CLOSE;
+ return PN_EXPIRE_WITH_CONNECTION;
if (!strncmp(symbol.start, "never", symbol.size))
- return PN_NEVER;
+ return PN_EXPIRE_NEVER;
- return PN_SESSION_CLOSE;
+ return PN_EXPIRE_WITH_SESSION;
}
static pn_distribution_mode_t symbol2dist_mode(const pn_bytes_t symbol)
@@ -672,7 +672,7 @@ int pn_do_attach(pn_dispatcher_t *disp)
link->state.delivery_count = idc;
}
- pn_collector_put(transport->connection->collector, PN_LINK_REMOTE_STATE, link);
+ pn_collector_put(transport->connection->collector, PN_LINK_REMOTE_OPEN, link);
return 0;
}
@@ -928,7 +928,7 @@ int pn_do_detach(pn_dispatcher_t *disp)
if (closed)
{
PN_SET_REMOTE(link->endpoint.state, PN_REMOTE_CLOSED);
- pn_collector_put(transport->connection->collector, PN_LINK_REMOTE_STATE, link);
+ pn_collector_put(transport->connection->collector, PN_LINK_REMOTE_CLOSE, link);
} else {
// TODO: implement
}
@@ -944,7 +944,7 @@ int pn_do_end(pn_dispatcher_t *disp)
int err = pn_scan_error(disp->args, &ssn->endpoint.remote_condition, SCAN_ERROR_DEFAULT);
if (err) return err;
PN_SET_REMOTE(ssn->endpoint.state, PN_REMOTE_CLOSED);
- pn_collector_put(transport->connection->collector, PN_SESSION_REMOTE_STATE, ssn);
+ pn_collector_put(transport->connection->collector, PN_SESSION_REMOTE_CLOSE, ssn);
pn_unmap_channel(transport, ssn);
return 0;
}
@@ -957,7 +957,7 @@ int pn_do_close(pn_dispatcher_t *disp)
if (err) return err;
transport->close_rcvd = true;
PN_SET_REMOTE(conn->endpoint.state, PN_REMOTE_CLOSED);
- pn_collector_put(transport->connection->collector, PN_CONNECTION_REMOTE_STATE, conn);
+ pn_collector_put(transport->connection->collector, PN_CONNECTION_REMOTE_CLOSE, conn);
return 0;
}
@@ -1219,13 +1219,13 @@ static const char *expiry_symbol(pn_expi
{
switch (policy)
{
- case PN_LINK_CLOSE:
+ case PN_EXPIRE_WITH_LINK:
return "link-detach";
- case PN_SESSION_CLOSE:
+ case PN_EXPIRE_WITH_SESSION:
return NULL;
- case PN_CONNECTION_CLOSE:
+ case PN_EXPIRE_WITH_CONNECTION:
return "connection-close";
- case PN_NEVER:
+ case PN_EXPIRE_NEVER:
return "never";
}
return NULL;
Modified: qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/Event.java
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/Event.java?rev=1611449&r1=1611448&r2=1611449&view=diff
==============================================================================
--- qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/Event.java (original)
+++ qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/Event.java Thu Jul 17 19:51:24 2014
@@ -29,25 +29,38 @@ package org.apache.qpid.proton.engine;
public interface Event
{
public enum Category {
- PROTOCOL;
+ CONNECTION,
+ SESSION,
+ LINK,
+ DELIVERY,
+ TRANSPORT;
}
public enum Type {
- CONNECTION_REMOTE_STATE(Category.PROTOCOL, 1),
- CONNECTION_LOCAL_STATE(Category.PROTOCOL, 2),
- SESSION_REMOTE_STATE(Category.PROTOCOL, 3),
- SESSION_LOCAL_STATE(Category.PROTOCOL, 4),
- LINK_REMOTE_STATE(Category.PROTOCOL, 5),
- LINK_LOCAL_STATE(Category.PROTOCOL, 6),
- LINK_FLOW(Category.PROTOCOL, 7),
- DELIVERY(Category.PROTOCOL, 8),
- TRANSPORT(Category.PROTOCOL, 9),
- CONNECTION_FINAL(Category.PROTOCOL, 10),
- SESSION_FINAL(Category.PROTOCOL, 11),
- LINK_FINAL(Category.PROTOCOL, 12),
- CONNECTION_INIT(Category.PROTOCOL, 13),
- SESSION_INIT(Category.PROTOCOL, 14),
- LINK_INIT(Category.PROTOCOL, 15);
+ CONNECTION_INIT(Category.CONNECTION, 1),
+ CONNECTION_OPEN(Category.CONNECTION, 2),
+ CONNECTION_REMOTE_OPEN(Category.CONNECTION, 3),
+ CONNECTION_CLOSE(Category.CONNECTION, 4),
+ CONNECTION_REMOTE_CLOSE(Category.CONNECTION, 5),
+ CONNECTION_FINAL(Category.CONNECTION, 6),
+
+ SESSION_INIT(Category.SESSION, 1),
+ SESSION_OPEN(Category.SESSION, 2),
+ SESSION_REMOTE_OPEN(Category.SESSION, 3),
+ SESSION_CLOSE(Category.SESSION, 4),
+ SESSION_REMOTE_CLOSE(Category.SESSION, 5),
+ SESSION_FINAL(Category.SESSION, 6),
+
+ LINK_INIT(Category.LINK, 1),
+ LINK_OPEN(Category.LINK, 2),
+ LINK_REMOTE_OPEN(Category.LINK, 3),
+ LINK_CLOSE(Category.LINK, 4),
+ LINK_REMOTE_CLOSE(Category.LINK, 5),
+ LINK_FLOW(Category.LINK, 6),
+ LINK_FINAL(Category.LINK, 7),
+
+ DELIVERY(Category.DELIVERY, 1),
+ TRANSPORT(Category.TRANSPORT, 1);
private int _opcode;
private Category _category;
Modified: qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/ConnectionImpl.java
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/ConnectionImpl.java?rev=1611449&r1=1611448&r2=1611449&view=diff
==============================================================================
--- qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/ConnectionImpl.java (original)
+++ qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/ConnectionImpl.java Thu Jul 17 19:51:24 2014
@@ -215,7 +215,7 @@ public class ConnectionImpl extends Endp
setRemoteDesiredCapabilities(open.getDesiredCapabilities());
setRemoteOfferedCapabilities(open.getOfferedCapabilities());
setRemoteProperties(open.getProperties());
- put(Event.Type.CONNECTION_REMOTE_STATE, this);
+ put(Event.Type.CONNECTION_REMOTE_OPEN, this);
}
@@ -608,8 +608,14 @@ public class ConnectionImpl extends Endp
}
@Override
- protected void localStateChanged()
+ void localOpen()
{
- put(Event.Type.CONNECTION_LOCAL_STATE, this);
+ put(Event.Type.CONNECTION_OPEN, this);
+ }
+
+ @Override
+ void localClose()
+ {
+ put(Event.Type.CONNECTION_CLOSE, this);
}
}
Modified: qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/EndpointImpl.java
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/EndpointImpl.java?rev=1611449&r1=1611448&r2=1611449&view=diff
==============================================================================
--- qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/EndpointImpl.java (original)
+++ qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/EndpointImpl.java Thu Jul 17 19:51:24 2014
@@ -55,7 +55,9 @@ public abstract class EndpointImpl imple
abstract void postFinal();
- protected abstract void localStateChanged();
+ abstract void localOpen();
+
+ abstract void localClose();
public void open()
{
@@ -67,7 +69,7 @@ public abstract class EndpointImpl imple
// TODO
case UNINITIALIZED:
_localState = EndpointState.ACTIVE;
- localStateChanged();
+ localOpen();
}
modified();
}
@@ -83,7 +85,7 @@ public abstract class EndpointImpl imple
// TODO
case ACTIVE:
_localState = EndpointState.CLOSED;
- localStateChanged();
+ localClose();
}
modified();
}
Modified: qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/EventImpl.java
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/EventImpl.java?rev=1611449&r1=1611448&r2=1611449&view=diff
==============================================================================
--- qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/EventImpl.java (original)
+++ qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/EventImpl.java Thu Jul 17 19:51:24 2014
@@ -73,11 +73,8 @@ class EventImpl implements Event
public Connection getConnection()
{
- switch (type) {
- case CONNECTION_REMOTE_STATE:
- case CONNECTION_LOCAL_STATE:
- case CONNECTION_INIT:
- case CONNECTION_FINAL:
+ switch (type.getCategory()) {
+ case CONNECTION:
return (Connection) context;
case TRANSPORT:
Transport transport = getTransport();
@@ -96,11 +93,8 @@ class EventImpl implements Event
public Session getSession()
{
- switch (type) {
- case SESSION_REMOTE_STATE:
- case SESSION_LOCAL_STATE:
- case SESSION_INIT:
- case SESSION_FINAL:
+ switch (type.getCategory()) {
+ case SESSION:
return (Session) context;
default:
Link link = getLink();
@@ -113,12 +107,8 @@ class EventImpl implements Event
public Link getLink()
{
- switch (type) {
- case LINK_REMOTE_STATE:
- case LINK_LOCAL_STATE:
- case LINK_INIT:
- case LINK_FINAL:
- case LINK_FLOW:
+ switch (type.getCategory()) {
+ case LINK:
return (Link) context;
default:
Delivery dlv = getDelivery();
@@ -131,7 +121,7 @@ class EventImpl implements Event
public Delivery getDelivery()
{
- switch (type) {
+ switch (type.getCategory()) {
case DELIVERY:
return (Delivery) context;
default:
@@ -141,7 +131,7 @@ class EventImpl implements Event
public Transport getTransport()
{
- switch (type) {
+ switch (type.getCategory()) {
case TRANSPORT:
return (Transport) context;
default:
Modified: qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/LinkImpl.java
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/LinkImpl.java?rev=1611449&r1=1611448&r2=1611449&view=diff
==============================================================================
--- qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/LinkImpl.java (original)
+++ qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/LinkImpl.java Thu Jul 17 19:51:24 2014
@@ -388,8 +388,14 @@ public abstract class LinkImpl extends E
}
@Override
- protected void localStateChanged()
+ void localOpen()
{
- getConnectionImpl().put(Event.Type.LINK_LOCAL_STATE, this);
+ getConnectionImpl().put(Event.Type.LINK_OPEN, this);
+ }
+
+ @Override
+ void localClose()
+ {
+ getConnectionImpl().put(Event.Type.LINK_CLOSE, this);
}
}
Modified: qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/SessionImpl.java
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/SessionImpl.java?rev=1611449&r1=1611448&r2=1611449&view=diff
==============================================================================
--- qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/SessionImpl.java (original)
+++ qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/SessionImpl.java Thu Jul 17 19:51:24 2014
@@ -199,8 +199,14 @@ public class SessionImpl extends Endpoin
}
@Override
- protected void localStateChanged()
+ void localOpen()
{
- getConnectionImpl().put(Event.Type.SESSION_LOCAL_STATE, this);
+ getConnectionImpl().put(Event.Type.SESSION_OPEN, this);
+ }
+
+ @Override
+ void localClose()
+ {
+ getConnectionImpl().put(Event.Type.SESSION_CLOSE, this);
}
}
Modified: qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java?rev=1611449&r1=1611448&r2=1611449&view=diff
==============================================================================
--- qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java (original)
+++ qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java Thu Jul 17 19:51:24 2014
@@ -993,7 +993,7 @@ public class TransportImpl extends Endpo
transportSession.setNextIncomingId(begin.getNextOutgoingId());
_remoteSessions.put(channel, transportSession);
- _connectionEndpoint.put(Event.Type.SESSION_REMOTE_STATE, session);
+ _connectionEndpoint.put(Event.Type.SESSION_REMOTE_OPEN, session);
}
}
@@ -1049,7 +1049,7 @@ public class TransportImpl extends Endpo
}
- _connectionEndpoint.put(Event.Type.LINK_REMOTE_STATE, link);
+ _connectionEndpoint.put(Event.Type.LINK_REMOTE_OPEN, link);
}
}
@@ -1121,7 +1121,7 @@ public class TransportImpl extends Endpo
link.getRemoteCondition().copyFrom(detach.getError());
}
- _connectionEndpoint.put(Event.Type.LINK_REMOTE_STATE, link);
+ _connectionEndpoint.put(Event.Type.LINK_REMOTE_CLOSE, link);
}
else
{
@@ -1150,7 +1150,7 @@ public class TransportImpl extends Endpo
session.getRemoteCondition().copyFrom(errorCondition);
}
- _connectionEndpoint.put(Event.Type.SESSION_REMOTE_STATE, session);
+ _connectionEndpoint.put(Event.Type.SESSION_REMOTE_CLOSE, session);
}
}
@@ -1167,7 +1167,7 @@ public class TransportImpl extends Endpo
_connectionEndpoint.getRemoteCondition().copyFrom(close.getError());
}
- _connectionEndpoint.put(Event.Type.CONNECTION_REMOTE_STATE, _connectionEndpoint);
+ _connectionEndpoint.put(Event.Type.CONNECTION_REMOTE_CLOSE, _connectionEndpoint);
}
}
@@ -1373,7 +1373,8 @@ public class TransportImpl extends Endpo
}
@Override
- protected void localStateChanged()
- {
- }
+ void localOpen() {}
+
+ @Override
+ void localClose() {}
}
Modified: qpid/proton/trunk/proton-j/src/main/resources/cengine.py
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-j/src/main/resources/cengine.py?rev=1611449&r1=1611448&r2=1611449&view=diff
==============================================================================
--- qpid/proton/trunk/proton-j/src/main/resources/cengine.py (original)
+++ qpid/proton/trunk/proton-j/src/main/resources/cengine.py Thu Jul 17 19:51:24 2014
@@ -57,10 +57,10 @@ PN_NONDURABLE = 0
PN_CONFIGURATION = 1
PN_DELIVERIES = 2
-PN_LINK_CLOSE = 0
-PN_SESSION_CLOSE = 1
-PN_CONNECTION_CLOSE = 2
-PN_NEVER = 3
+PN_EXPIRE_WITH_LINK = 0
+PN_EXPIRE_WITH_SESSION = 1
+PN_EXPIRE_WITH_CONNECTION = 2
+PN_EXPIRE_NEVER = 3
PN_DIST_MODE_UNSPECIFIED = 0
PN_DIST_MODE_COPY = 1
@@ -357,17 +357,17 @@ DURABILITY_J2P = {
}
EXPIRY_POLICY_P2J = {
- PN_LINK_CLOSE: TerminusExpiryPolicy.LINK_DETACH,
- PN_SESSION_CLOSE: TerminusExpiryPolicy.SESSION_END,
- PN_CONNECTION_CLOSE: TerminusExpiryPolicy.CONNECTION_CLOSE,
- PN_NEVER: TerminusExpiryPolicy.NEVER
+ PN_EXPIRE_WITH_LINK: TerminusExpiryPolicy.LINK_DETACH,
+ PN_EXPIRE_WITH_SESSION: TerminusExpiryPolicy.SESSION_END,
+ PN_EXPIRE_WITH_CONNECTION: TerminusExpiryPolicy.CONNECTION_CLOSE,
+ PN_EXPIRE_NEVER: TerminusExpiryPolicy.NEVER
}
EXPIRY_POLICY_J2P = {
- TerminusExpiryPolicy.LINK_DETACH: PN_LINK_CLOSE,
- TerminusExpiryPolicy.SESSION_END: PN_SESSION_CLOSE,
- TerminusExpiryPolicy.CONNECTION_CLOSE: PN_CONNECTION_CLOSE,
- TerminusExpiryPolicy.NEVER: PN_NEVER
+ TerminusExpiryPolicy.LINK_DETACH: PN_EXPIRE_WITH_LINK,
+ TerminusExpiryPolicy.SESSION_END: PN_EXPIRE_WITH_SESSION,
+ TerminusExpiryPolicy.CONNECTION_CLOSE: PN_EXPIRE_WITH_CONNECTION,
+ TerminusExpiryPolicy.NEVER: PN_EXPIRE_NEVER
}
DISTRIBUTION_MODE_P2J = {
@@ -388,7 +388,7 @@ class pn_terminus:
self.type = type
self.address = None
self.durability = PN_NONDURABLE
- self.expiry_policy = PN_SESSION_CLOSE
+ self.expiry_policy = PN_EXPIRE_WITH_SESSION
self.distribution_mode = PN_DIST_MODE_UNSPECIFIED
self.timeout = 0
self.dynamic = False
@@ -945,19 +945,29 @@ def pn_transport_error(trans):
from org.apache.qpid.proton.engine import Event
-PN_EVENT_CATEGORY_PROTOCOL = Event.Category.PROTOCOL
+PN_EVENT_CATEGORY_CONNECTION = Event.Category.CONNECTION
+PN_EVENT_CATEGORY_SESSION = Event.Category.SESSION
+PN_EVENT_CATEGORY_LINK = Event.Category.LINK
+PN_EVENT_CATEGORY_DELIVERY = Event.Category.DELIVERY
+PN_EVENT_CATEGORY_TRANSPORT = Event.Category.TRANSPORT
PN_CONNECTION_INIT = Event.Type.CONNECTION_INIT
-PN_CONNECTION_LOCAL_STATE = Event.Type.CONNECTION_LOCAL_STATE
-PN_CONNECTION_REMOTE_STATE = Event.Type.CONNECTION_REMOTE_STATE
+PN_CONNECTION_OPEN = Event.Type.CONNECTION_OPEN
+PN_CONNECTION_REMOTE_OPEN = Event.Type.CONNECTION_REMOTE_OPEN
+PN_CONNECTION_CLOSE = Event.Type.CONNECTION_CLOSE
+PN_CONNECTION_REMOTE_CLOSE = Event.Type.CONNECTION_REMOTE_CLOSE
PN_CONNECTION_FINAL = Event.Type.CONNECTION_FINAL
PN_SESSION_INIT = Event.Type.SESSION_INIT
-PN_SESSION_LOCAL_STATE = Event.Type.SESSION_LOCAL_STATE
-PN_SESSION_REMOTE_STATE = Event.Type.SESSION_REMOTE_STATE
+PN_SESSION_OPEN = Event.Type.SESSION_OPEN
+PN_SESSION_REMOTE_OPEN = Event.Type.SESSION_REMOTE_OPEN
+PN_SESSION_CLOSE = Event.Type.SESSION_CLOSE
+PN_SESSION_REMOTE_CLOSE = Event.Type.SESSION_REMOTE_CLOSE
PN_SESSION_FINAL = Event.Type.SESSION_FINAL
PN_LINK_INIT = Event.Type.LINK_INIT
-PN_LINK_LOCAL_STATE = Event.Type.LINK_LOCAL_STATE
-PN_LINK_REMOTE_STATE = Event.Type.LINK_REMOTE_STATE
+PN_LINK_OPEN = Event.Type.LINK_OPEN
+PN_LINK_REMOTE_OPEN = Event.Type.LINK_REMOTE_OPEN
+PN_LINK_CLOSE = Event.Type.LINK_CLOSE
+PN_LINK_REMOTE_CLOSE = Event.Type.LINK_REMOTE_CLOSE
PN_LINK_FLOW = Event.Type.LINK_FLOW
PN_LINK_FINAL = Event.Type.LINK_FINAL
PN_DELIVERY = Event.Type.DELIVERY
Modified: qpid/proton/trunk/tests/python/proton_tests/engine.py
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/tests/python/proton_tests/engine.py?rev=1611449&r1=1611448&r2=1611449&view=diff
==============================================================================
--- qpid/proton/trunk/tests/python/proton_tests/engine.py (original)
+++ qpid/proton/trunk/tests/python/proton_tests/engine.py Thu Jul 17 19:51:24 2014
@@ -2115,7 +2115,7 @@ class EventTest(Test):
self.expect()
c2.open()
self.pump()
- self.expect(Event.CONNECTION_REMOTE_STATE)
+ self.expect(Event.CONNECTION_REMOTE_OPEN)
self.pump()
self.expect()
@@ -2126,8 +2126,8 @@ class EventTest(Test):
self.expect()
self.pump()
- self.expect(Event.SESSION_INIT, Event.SESSION_REMOTE_STATE,
- Event.LINK_INIT, Event.LINK_REMOTE_STATE)
+ self.expect(Event.SESSION_INIT, Event.SESSION_REMOTE_OPEN,
+ Event.LINK_INIT, Event.LINK_REMOTE_OPEN)
c1.open()
ssn2 = c1.session()
@@ -2135,25 +2135,25 @@ class EventTest(Test):
rcv = ssn2.receiver("receiver")
rcv.open()
self.pump()
- self.expect(Event.CONNECTION_LOCAL_STATE, Event.TRANSPORT,
- Event.SESSION_INIT, Event.SESSION_LOCAL_STATE,
- Event.TRANSPORT, Event.LINK_INIT, Event.LINK_LOCAL_STATE,
+ self.expect(Event.CONNECTION_OPEN, Event.TRANSPORT,
+ Event.SESSION_INIT, Event.SESSION_OPEN,
+ Event.TRANSPORT, Event.LINK_INIT, Event.LINK_OPEN,
Event.TRANSPORT)
rcv.close()
- self.expect(Event.LINK_LOCAL_STATE, Event.TRANSPORT)
+ self.expect(Event.LINK_CLOSE, Event.TRANSPORT)
self.pump()
rcv.free()
del rcv
self.expect(Event.LINK_FINAL)
ssn2.free()
del ssn2
- self.expect(Event.SESSION_LOCAL_STATE, Event.TRANSPORT)
+ self.expect(Event.SESSION_CLOSE, Event.TRANSPORT)
self.pump()
self.expect(Event.SESSION_FINAL)
c1.free()
c1._transport.unbind()
- self.expect(Event.CONNECTION_LOCAL_STATE, Event.TRANSPORT,
+ self.expect(Event.CONNECTION_CLOSE, Event.TRANSPORT,
Event.LINK_FINAL, Event.SESSION_FINAL, Event.CONNECTION_FINAL)
def testConnectionINIT_FINAL(self):
@@ -2194,7 +2194,7 @@ class EventTest(Test):
rcv.flow(10)
self.pump()
self.expect(Event.CONNECTION_INIT, Event.SESSION_INIT,
- Event.LINK_INIT, Event.LINK_REMOTE_STATE, Event.LINK_FLOW)
+ Event.LINK_INIT, Event.LINK_REMOTE_OPEN, Event.LINK_FLOW)
rcv.flow(10)
self.pump()
self.expect(Event.LINK_FLOW)
@@ -2207,7 +2207,7 @@ class EventTest(Test):
rcv.flow(10)
self.pump()
self.expect(Event.CONNECTION_INIT, Event.SESSION_INIT,
- Event.LINK_INIT, Event.LINK_LOCAL_STATE, Event.TRANSPORT,
+ Event.LINK_INIT, Event.LINK_OPEN, Event.TRANSPORT,
Event.TRANSPORT)
snd.delivery("delivery")
snd.send("Hello World!")
@@ -2216,15 +2216,15 @@ class EventTest(Test):
self.expect()
snd.open()
self.pump()
- self.expect(Event.LINK_REMOTE_STATE, Event.DELIVERY)
+ self.expect(Event.LINK_REMOTE_OPEN, Event.DELIVERY)
rcv.session.connection._transport.unbind()
rcv.session.connection.free()
- self.expect_oneof((Event.TRANSPORT, Event.TRANSPORT, Event.TRANSPORT, Event.LINK_LOCAL_STATE,
- Event.SESSION_LOCAL_STATE, Event.CONNECTION_LOCAL_STATE, Event.LINK_FINAL,
+ self.expect_oneof((Event.TRANSPORT, Event.TRANSPORT, Event.TRANSPORT, Event.LINK_CLOSE,
+ Event.SESSION_CLOSE, Event.CONNECTION_CLOSE, Event.LINK_FINAL,
Event.SESSION_FINAL, Event.CONNECTION_FINAL),
- (Event.TRANSPORT, Event.TRANSPORT, Event.TRANSPORT, Event.LINK_LOCAL_STATE,
- Event.LINK_FINAL, Event.SESSION_LOCAL_STATE, Event.SESSION_FINAL,
- Event.CONNECTION_LOCAL_STATE, Event.CONNECTION_FINAL))
+ (Event.TRANSPORT, Event.TRANSPORT, Event.TRANSPORT, Event.LINK_CLOSE,
+ Event.LINK_FINAL, Event.SESSION_CLOSE, Event.SESSION_FINAL,
+ Event.CONNECTION_CLOSE, Event.CONNECTION_FINAL))
def testDeliveryEventsDisp(self):
snd, rcv = self.testFlowEvents()
@@ -2232,7 +2232,7 @@ class EventTest(Test):
dlv = snd.delivery("delivery")
snd.send("Hello World!")
assert snd.advance()
- self.expect(Event.LINK_LOCAL_STATE,
+ self.expect(Event.LINK_OPEN,
Event.TRANSPORT,
Event.TRANSPORT,
Event.TRANSPORT)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org