qpid-proton git commit: PROTON-1386: Disable PHP binding by default

2017-01-10 Thread astitcher
Repository: qpid-proton
Updated Branches:
  refs/heads/master 951dcb4e1 -> 431c00d5f


PROTON-1386: Disable PHP binding by default


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/431c00d5
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/431c00d5
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/431c00d5

Branch: refs/heads/master
Commit: 431c00d5f3198192c72cdb5aba10c111b19da7a8
Parents: 951dcb4
Author: Andrew Stitcher 
Authored: Tue Jan 10 16:41:33 2017 -0500
Committer: Andrew Stitcher 
Committed: Tue Jan 10 16:41:33 2017 -0500

--
 proton-c/CMakeLists.txt  | 4 
 proton-c/bindings/CMakeLists.txt | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/431c00d5/proton-c/CMakeLists.txt
--
diff --git a/proton-c/CMakeLists.txt b/proton-c/CMakeLists.txt
index f674eee..8edb661 100644
--- a/proton-c/CMakeLists.txt
+++ b/proton-c/CMakeLists.txt
@@ -190,6 +190,10 @@ endif (PN_WINAPI)
 
 # Try to keep any platform specific overrides together here:
 
+# Until we can decide what to do with PHP support, turn it off by default
+# (We can't build with recent versions of PHP)
+set (NOBUILD_PHP ON)
+
 # MacOS has a bunch of differences in build tools and process and so we have 
to turn some things
 # off if building there:
 if (APPLE)

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/431c00d5/proton-c/bindings/CMakeLists.txt
--
diff --git a/proton-c/bindings/CMakeLists.txt b/proton-c/bindings/CMakeLists.txt
index 37943dc..6b88384 100644
--- a/proton-c/bindings/CMakeLists.txt
+++ b/proton-c/bindings/CMakeLists.txt
@@ -134,7 +134,7 @@ endif()
 foreach(BINDING ${BINDINGS})
   string(TOUPPER ${BINDING} UBINDING)
   # Check whether default was overridden
-  if ("NOBUILD_${UBINDING}")
+  if (NOBUILD_${UBINDING})
 set ("DEFAULT_${UBINDING}" OFF)
   endif ()
   option("BUILD_${UBINDING}" "Build ${BINDING} language binding" 
${DEFAULT_${UBINDING}})


-
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org



[15/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/bindings/ruby/lib/util/error_handler.rb
--
diff --git a/proton-c/bindings/ruby/lib/util/error_handler.rb 
b/proton-c/bindings/ruby/lib/util/error_handler.rb
deleted file mode 100644
index da51214..000
--- a/proton-c/bindings/ruby/lib/util/error_handler.rb
+++ /dev/null
@@ -1,127 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you 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.
-#++
-
-module Qpid::Proton::Util
-
-  # Provides mixin functionality for dealing with exception conditions.
-  #
-  # @private
-  module ErrorHandler
-
-def self.included(base)
-  base.extend(self)
-
-  unless defined? base.to_be_wrapped
-class << base
-  @@to_be_wrapped = []
-end
-  end
-
-  define_method :method_added do |name|
-if (!@@to_be_wrapped.nil?) && (@@to_be_wrapped.include? name)
-  @@to_be_wrapped.delete name
-  create_exception_handler_wrapper(name)
-end
-  end
-end
-
-def can_raise_error(method_names, options = {})
-  error_class = options[:error_class]
-  below = options[:below] || 0
-  # coerce the names to be an array
-  Array(method_names).each do |method_name|
-# if the method doesn't already exist then queue this aliasing
-unless self.method_defined? method_name
-  @@to_be_wrapped ||= []
-  @@to_be_wrapped << method_name
-else
-  create_exception_handler_wrapper(method_name, error_class, below)
-end
-  end
-end
-
-def create_exception_handler_wrapper(method_name, error_class = nil, below 
= 0)
-  original_method_name = method_name.to_s
-  wrapped_method_name = "_excwrap_#{original_method_name}"
-  alias_method wrapped_method_name, original_method_name
-  define_method original_method_name do |*args, |
-# need to get a reference to the method object itself since
-# calls to Class.send interfere with Messenger.send
-method = self.method(wrapped_method_name.to_sym)
-rc = method.call(*args, )
-check_for_error(rc, error_class) if rc < below
-return rc
-  end
-end
-
-# Raises an Proton-specific error if a return code is non-zero.
-#
-# Expects the class to provide an +error+ method.
-def check_for_error(code, error_class = nil)
-
-  raise ::ArgumentError.new("Invalid error code: #{code}") if code.nil?
-
-  return code if code > 0
-
-  case(code)
-
-  when Qpid::Proton::Error::NONE
-return
-
-  when Qpid::Proton::Error::EOS
-raise Qpid::Proton::EOSError.new(self.error)
-
-  when Qpid::Proton::Error::ERROR
-raise Qpid::Proton::ProtonError.new(self.error)
-
-  when Qpid::Proton::Error::OVERFLOW
-raise Qpid::Proton::OverflowError.new(self.error)
-
-  when Qpid::Proton::Error::UNDERFLOW
-raise Qpid::Proton::UnderflowError.new(self.error)
-
-  when Qpid::Proton::Error::ARGUMENT
-raise Qpid::Proton::ArgumentError.new(self.error)
-
-  when Qpid::Proton::Error::STATE
-raise Qpid::Proton::StateError.new(self.error)
-
-  when Qpid::Proton::Error::TIMEOUT
-raise Qpid::Proton::TimeoutError.new(self.error)
-
-  when Qpid::Proton::Error::INPROGRESS
-return
-
-  when Qpid::Proton::Error::INTERRUPTED
-raise Qpid::Proton::InterruptedError.new(self.error)
-
-  when Qpid::Proton::Error::INPROGRESS
-raise Qpid::Proton::InProgressError.new(self.error)
-
-  else
-
-raise ::ArgumentError.new("Unknown error code: #{code}")
-
-  end
-
-end
-
-  end
-
-end

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/bindings/ruby/lib/util/handler.rb
--
diff --git a/proton-c/bindings/ruby/lib/util/handler.rb 
b/proton-c/bindings/ruby/lib/util/handler.rb
deleted file mode 100644
index e7d07b1..000
--- a/proton-c/bindings/ruby/lib/util/handler.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the 

[25/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/bindings/javascript/qpid-proton-messenger/LICENSE
--
diff --git a/proton-c/bindings/javascript/qpid-proton-messenger/LICENSE 
b/proton-c/bindings/javascript/qpid-proton-messenger/LICENSE
deleted file mode 100644
index 6b0b127..000
--- a/proton-c/bindings/javascript/qpid-proton-messenger/LICENSE
+++ /dev/null
@@ -1,203 +0,0 @@
-
- Apache License
-   Version 2.0, January 2004
-http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-  "License" shall mean the terms and conditions for use, reproduction,
-  and distribution as defined by Sections 1 through 9 of this document.
-
-  "Licensor" shall mean the copyright owner or entity authorized by
-  the copyright owner that is granting the License.
-
-  "Legal Entity" shall mean the union of the acting entity and all
-  other entities that control, are controlled by, or are under common
-  control with that entity. For the purposes of this definition,
-  "control" means (i) the power, direct or indirect, to cause the
-  direction or management of such entity, whether by contract or
-  otherwise, or (ii) ownership of fifty percent (50%) or more of the
-  outstanding shares, or (iii) beneficial ownership of such entity.
-
-  "You" (or "Your") shall mean an individual or Legal Entity
-  exercising permissions granted by this License.
-
-  "Source" form shall mean the preferred form for making modifications,
-  including but not limited to software source code, documentation
-  source, and configuration files.
-
-  "Object" form shall mean any form resulting from mechanical
-  transformation or translation of a Source form, including but
-  not limited to compiled object code, generated documentation,
-  and conversions to other media types.
-
-  "Work" shall mean the work of authorship, whether in Source or
-  Object form, made available under the License, as indicated by a
-  copyright notice that is included in or attached to the work
-  (an example is provided in the Appendix below).
-
-  "Derivative Works" shall mean any work, whether in Source or Object
-  form, that is based on (or derived from) the Work and for which the
-  editorial revisions, annotations, elaborations, or other modifications
-  represent, as a whole, an original work of authorship. For the purposes
-  of this License, Derivative Works shall not include works that remain
-  separable from, or merely link (or bind by name) to the interfaces of,
-  the Work and Derivative Works thereof.
-
-  "Contribution" shall mean any work of authorship, including
-  the original version of the Work and any modifications or additions
-  to that Work or Derivative Works thereof, that is intentionally
-  submitted to Licensor for inclusion in the Work by the copyright owner
-  or by an individual or Legal Entity authorized to submit on behalf of
-  the copyright owner. For the purposes of this definition, "submitted"
-  means any form of electronic, verbal, or written communication sent
-  to the Licensor or its representatives, including but not limited to
-  communication on electronic mailing lists, source code control systems,
-  and issue tracking systems that are managed by, or on behalf of, the
-  Licensor for the purpose of discussing and improving the Work, but
-  excluding communication that is conspicuously marked or otherwise
-  designated in writing by the copyright owner as "Not a Contribution."
-
-  "Contributor" shall mean Licensor and any individual or Legal Entity
-  on behalf of whom a Contribution has been received by Licensor and
-  subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-  this License, each Contributor hereby grants to You a perpetual,
-  worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-  copyright license to reproduce, prepare Derivative Works of,
-  publicly display, publicly perform, sublicense, and distribute the
-  Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-  this License, each Contributor hereby grants to You a perpetual,
-  worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-  (except as stated in this section) patent license to make, have made,
-  use, offer to sell, sell, import, and otherwise transfer the Work,
-  where such license applies only to those patent claims licensable
-  by such Contributor that are necessarily infringed by their
-  Contribution(s) 

[41/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/examples/python/messenger/server.py
--
diff --git a/examples/python/messenger/server.py 
b/examples/python/messenger/server.py
deleted file mode 100755
index 8c25879..000
--- a/examples/python/messenger/server.py
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/usr/bin/python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you 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.
-#
-from __future__ import print_function
-import sys, optparse
-from proton import *
-
-parser = optparse.OptionParser(usage="usage: %prog  ... ",
-   description="simple message server")
-
-opts, args = parser.parse_args()
-
-if not args:
-  args = ["amqp://~0.0.0.0"]
-
-mng = Messenger()
-mng.start()
-
-for a in args:
-  mng.subscribe(a)
-
-def dispatch(request, response):
-  if request.subject:
-response.subject = "Re: %s" % request.subject
-  response.properties = request.properties
-  print("Dispatched %s %s" % (request.subject, request.properties))
-
-msg = Message()
-reply = Message()
-
-while True:
-  if mng.incoming < 10:
-mng.recv(10)
-
-  if mng.incoming > 0:
-mng.get(msg)
-if msg.reply_to:
-  print(msg.reply_to)
-  reply.address = msg.reply_to
-  reply.correlation_id = msg.correlation_id
-  reply.body = msg.body
-dispatch(msg, reply)
-mng.put(reply)
-mng.send()
-
-mng.stop()

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/examples/python/proton-server.conf
--
diff --git a/examples/python/proton-server.conf 
b/examples/python/proton-server.conf
deleted file mode 100644
index 6d236fe..000
--- a/examples/python/proton-server.conf
+++ /dev/null
@@ -1 +0,0 @@
-mech_list: EXTERNAL ANONYMOUS

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/examples/python/proton_server.py
--
diff --git a/examples/python/proton_server.py b/examples/python/proton_server.py
deleted file mode 100755
index 9351f55..000
--- a/examples/python/proton_server.py
+++ /dev/null
@@ -1,51 +0,0 @@
-from __future__ import print_function
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you 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.
-#
-
-from proton import Message
-from proton.reactor import Container
-from proton.handlers import MessagingHandler
-
-class Server(MessagingHandler):
-def __init__(self, host, address):
-super(Server, self).__init__()
-self.container = Container(self)
-self.conn = self.container.connect(host)
-self.receiver = self.container.create_receiver(self.conn, address)
-self.sender = self.container.create_sender(self.conn, None)
-
-def on_message(self, event):
-self.on_request(event.message.body, event.message.reply_to)
-
-def on_connection_close(self, endpoint, error):
-if error: print("Closed due to %s" % error)
-self.conn.close()
-
-def run(self):
-self.container.run()
-
-def send(self, response, reply_to):
-msg = Message(body=response)
-if self.sender:
-msg.address = reply_to
-self.sender.send(msg)
-
-def on_request(self, request, reply_to):
-pass
-

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/examples/python/proton_tornado.py
--
diff --git 

[05/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/src/core/message.c
--
diff --git a/proton-c/src/core/message.c b/proton-c/src/core/message.c
deleted file mode 100644
index f2fb20e..000
--- a/proton-c/src/core/message.c
+++ /dev/null
@@ -1,862 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- *
- */
-
-#include "platform/platform_fmt.h"
-#include "protocol.h"
-#include "util.h"
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-// message
-
-struct pn_message_t {
-  pn_timestamp_t expiry_time;
-  pn_timestamp_t creation_time;
-  pn_data_t *id;
-  pn_string_t *user_id;
-  pn_string_t *address;
-  pn_string_t *subject;
-  pn_string_t *reply_to;
-  pn_data_t *correlation_id;
-  pn_string_t *content_type;
-  pn_string_t *content_encoding;
-  pn_string_t *group_id;
-  pn_string_t *reply_to_group_id;
-
-  pn_data_t *data;
-  pn_data_t *instructions;
-  pn_data_t *annotations;
-  pn_data_t *properties;
-  pn_data_t *body;
-
-  pn_error_t *error;
-
-  pn_sequence_t group_sequence;
-  pn_millis_t ttl;
-  uint32_t delivery_count;
-
-  uint8_t priority;
-
-  bool durable;
-  bool first_acquirer;
-  bool inferred;
-};
-
-void pn_message_finalize(void *obj)
-{
-  pn_message_t *msg = (pn_message_t *) obj;
-  pn_free(msg->user_id);
-  pn_free(msg->address);
-  pn_free(msg->subject);
-  pn_free(msg->reply_to);
-  pn_free(msg->content_type);
-  pn_free(msg->content_encoding);
-  pn_free(msg->group_id);
-  pn_free(msg->reply_to_group_id);
-  pn_data_free(msg->id);
-  pn_data_free(msg->correlation_id);
-  pn_data_free(msg->data);
-  pn_data_free(msg->instructions);
-  pn_data_free(msg->annotations);
-  pn_data_free(msg->properties);
-  pn_data_free(msg->body);
-  pn_error_free(msg->error);
-}
-
-int pn_message_inspect(void *obj, pn_string_t *dst)
-{
-  pn_message_t *msg = (pn_message_t *) obj;
-  int err = pn_string_addf(dst, "Message{");
-  if (err) return err;
-
-  bool comma = false;
-
-  if (pn_string_get(msg->address)) {
-err = pn_string_addf(dst, "address=");
-if (err) return err;
-err = pn_inspect(msg->address, dst);
-if (err) return err;
-err = pn_string_addf(dst, ", ");
-if (err) return err;
-comma = true;
-  }
-
-  if (msg->durable) {
-err = pn_string_addf(dst, "durable=%i, ", msg->durable);
-if (err) return err;
-comma = true;
-  }
-
-  if (msg->priority != PN_DEFAULT_PRIORITY) {
-err = pn_string_addf(dst, "priority=%i, ", msg->priority);
-if (err) return err;
-comma = true;
-  }
-
-  if (msg->ttl) {
-err = pn_string_addf(dst, "ttl=%" PRIu32 ", ", msg->ttl);
-if (err) return err;
-comma = true;
-  }
-
-  if (msg->first_acquirer) {
-err = pn_string_addf(dst, "first_acquirer=%i, ", msg->first_acquirer);
-if (err) return err;
-comma = true;
-  }
-
-  if (msg->delivery_count) {
-err = pn_string_addf(dst, "delivery_count=%" PRIu32 ", ", 
msg->delivery_count);
-if (err) return err;
-comma = true;
-  }
-
-  if (pn_data_size(msg->id)) {
-err = pn_string_addf(dst, "id=");
-if (err) return err;
-err = pn_inspect(msg->id, dst);
-if (err) return err;
-err = pn_string_addf(dst, ", ");
-if (err) return err;
-comma = true;
-  }
-
-  if (pn_string_get(msg->user_id)) {
-err = pn_string_addf(dst, "user_id=");
-if (err) return err;
-err = pn_inspect(msg->user_id, dst);
-if (err) return err;
-err = pn_string_addf(dst, ", ");
-if (err) return err;
-comma = true;
-  }
-
-  if (pn_string_get(msg->subject)) {
-err = pn_string_addf(dst, "subject=");
-if (err) return err;
-err = pn_inspect(msg->subject, dst);
-if (err) return err;
-err = pn_string_addf(dst, ", ");
-if (err) return err;
-comma = true;
-  }
-
-  if (pn_string_get(msg->reply_to)) {
-err = pn_string_addf(dst, "reply_to=");
-if (err) return err;
-err = pn_inspect(msg->reply_to, dst);
-if (err) return err;
-err = pn_string_addf(dst, ", ");
-if (err) return err;
-comma = true;
-  }
-
-  if (pn_data_size(msg->correlation_id)) {
-err = pn_string_addf(dst, 

[31/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/bindings/go/src/qpid.apache.org/amqp/interop_test.go
--
diff --git a/proton-c/bindings/go/src/qpid.apache.org/amqp/interop_test.go 
b/proton-c/bindings/go/src/qpid.apache.org/amqp/interop_test.go
deleted file mode 100644
index b3e27bc..000
--- a/proton-c/bindings/go/src/qpid.apache.org/amqp/interop_test.go
+++ /dev/null
@@ -1,385 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you 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.
-*/
-
-// Test that conversion of Go type to/from AMQP is compatible with other
-// bindings.
-//
-package amqp
-
-import (
-   "bytes"
-   "fmt"
-   "io"
-   "io/ioutil"
-   "os"
-   "reflect"
-   "strings"
-   "testing"
-)
-
-func checkEqual(want interface{}, got interface{}) error {
-   if !reflect.DeepEqual(want, got) {
-   return fmt.Errorf("%#v != %#v", want, got)
-   }
-   return nil
-}
-
-func getReader(t *testing.T, name string) (r io.Reader) {
-   dir := os.Getenv("PN_INTEROP_DIR")
-   if dir == "" {
-   t.Skip("no PN_INTEROP_DIR in environment")
-   }
-   r, err := os.Open(dir + "/" + name + ".amqp")
-   if err != nil {
-   t.Fatalf("can't open %#v: %v", name, err)
-   }
-   return
-}
-
-func remaining(d *Decoder) string {
-   remainder, _ := ioutil.ReadAll(io.MultiReader(d.Buffered(), d.reader))
-   return string(remainder)
-}
-
-// checkDecode: want is the expected value, gotPtr is a pointer to a
-// instance of the same type for Decode.
-func checkDecode(d *Decoder, want interface{}, gotPtr interface{}, t 
*testing.T) {
-
-   if err := d.Decode(gotPtr); err != nil {
-   t.Error("Decode failed", err)
-   return
-   }
-   got := reflect.ValueOf(gotPtr).Elem().Interface()
-   if err := checkEqual(want, got); err != nil {
-   t.Error("Decode bad value:", err)
-   return
-   }
-
-   // Try round trip encoding
-   bytes, err := Marshal(want, nil)
-   if err != nil {
-   t.Error("Marshal failed", err)
-   return
-   }
-   n, err := Unmarshal(bytes, gotPtr)
-   if err != nil {
-   t.Error("Unmarshal failed", err)
-   return
-   }
-   if err := checkEqual(n, len(bytes)); err != nil {
-   t.Error("Bad unmarshal length", err)
-   return
-   }
-   got = reflect.ValueOf(gotPtr).Elem().Interface()
-   if err = checkEqual(want, got); err != nil {
-   t.Error("Bad unmarshal value", err)
-   return
-   }
-}
-
-func TestUnmarshal(t *testing.T) {
-   bytes, err := ioutil.ReadAll(getReader(t, "strings"))
-   if err != nil {
-   t.Error(err)
-   }
-   for _, want := range []string{"abc\000defg", "abcdefg", "abcdefg", "", 
"", ""} {
-   var got string
-   n, err := Unmarshal(bytes, )
-   if err != nil {
-   t.Error(err)
-   }
-   if want != got {
-   t.Errorf("%#v != %#v", want, got)
-   }
-   bytes = bytes[n:]
-   }
-}
-
-func TestPrimitivesExact(t *testing.T) {
-   d := NewDecoder(getReader(t, "primitives"))
-   // Decoding into exact types
-   var b bool
-   checkDecode(d, true, , t)
-   checkDecode(d, false, , t)
-   var u8 uint8
-   checkDecode(d, uint8(42), , t)
-   var u16 uint16
-   checkDecode(d, uint16(42), , t)
-   var i16 int16
-   checkDecode(d, int16(-42), , t)
-   var u32 uint32
-   checkDecode(d, uint32(12345), , t)
-   var i32 int32
-   checkDecode(d, int32(-12345), , t)
-   var u64 uint64
-   checkDecode(d, uint64(12345), , t)
-   var i64 int64
-   checkDecode(d, int64(-12345), , t)
-   var f32 float32
-   checkDecode(d, float32(0.125), , t)
-   var f64 float64
-   checkDecode(d, float64(0.125), , t)
-}
-
-func TestPrimitivesCompatible(t *testing.T) {
-   d := NewDecoder(getReader(t, "primitives"))
-   // Decoding into compatible types
-   var b bool
-   var i int
-   var 

[52/55] qpid-proton-j git commit: PROTON-1362: remove previously-deprecated Messenger

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2afe2ec0/tests/python/proton_tests/soak.py
--
diff --git a/tests/python/proton_tests/soak.py 
b/tests/python/proton_tests/soak.py
deleted file mode 100644
index 52382ba..000
--- a/tests/python/proton_tests/soak.py
+++ /dev/null
@@ -1,368 +0,0 @@
-from __future__ import absolute_import
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you 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.
-#
-import os
-import sys
-from .common import Test, Skipped, free_tcp_ports, \
-MessengerReceiverC, MessengerSenderC, \
-MessengerReceiverValgrind, MessengerSenderValgrind, \
-MessengerReceiverPython, MessengerSenderPython, \
-ReactorReceiverC, ReactorSenderC, \
-ReactorReceiverValgrind, ReactorSenderValgrind, \
-isSSLPresent
-from proton import *
-
-#
-# Tests that run the apps
-#
-
-class AppTests(Test):
-
-def __init__(self, *args):
-Test.__init__(self, *args)
-self.is_valgrind = False
-
-def default(self, name, value, **kwargs):
-if self.is_valgrind:
-default = kwargs.get("valgrind", value)
-else:
-default = value
-return Test.default(self, name, default, **kwargs)
-
-@property
-def iterations(self):
-return int(self.default("iterations", 2, fast=1, valgrind=2))
-
-@property
-def send_count(self):
-return int(self.default("send_count", 17, fast=1, valgrind=2))
-
-@property
-def target_count(self):
-return int(self.default("target_count", 5, fast=1, valgrind=2))
-
-@property
-def send_batch(self):
-return int(self.default("send_batch", 7, fast=1, valgrind=2))
-
-@property
-def forward_count(self):
-return int(self.default("forward_count", 5, fast=1, valgrind=2))
-
-@property
-def port_count(self):
-return int(self.default("port_count", 3, fast=1, valgrind=2))
-
-@property
-def sender_count(self):
-return int(self.default("sender_count", 3, fast=1, valgrind=2))
-
-def valgrind_test(self):
-self.is_valgrind = True
-
-def setUp(self):
-self.senders = []
-self.receivers = []
-
-def tearDown(self):
-pass
-
-def _do_test(self, iterations=1):
-verbose = self.verbose
-
-for R in self.receivers:
-R.start( verbose )
-
-for j in range(iterations):
-for S in self.senders:
-S.start( verbose )
-
-for S in self.senders:
-S.wait()
-#print("SENDER OUTPUT:")
-#print( S.stdout() )
-assert S.status() == 0, ("Command '%s' failed status=%d: '%s' 
'%s'"
- % (str(S.cmdline()),
-S.status(),
-S.stdout(),
-S.stderr()))
-
-for R in self.receivers:
-R.wait()
-#print("RECEIVER OUTPUT")
-#print( R.stdout() )
-assert R.status() == 0, ("Command '%s' failed status=%d: '%s' '%s'"
- % (str(R.cmdline()),
-R.status(),
-R.stdout(),
-R.stderr()))
-
-#
-# Traffic passing tests based on the Messenger apps
-#
-
-class MessengerTests(AppTests):
-
-_timeout = 60
-
-def _ssl_check(self):
-if not isSSLPresent():
-raise Skipped("No SSL libraries found.")
-if os.name=="nt":
-raise Skipped("Windows SChannel lacks anonymous cipher support.")
-
-def __init__(self, *args):
-AppTests.__init__(self, *args)
-
-def _do_oneway_test(self, receiver, sender, domain="amqp"):
-""" Send N messages to a receiver.
-Parameters:
-iterations - repeat the senders this many times
-target_count = # of targets to send to.
-send_count = # messages sent to each target
-"""
-iterations = self.iterations
-send_count = self.send_count
-target_count = self.target_count
-
-

[28/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/bindings/javascript/LICENSE
--
diff --git a/proton-c/bindings/javascript/LICENSE 
b/proton-c/bindings/javascript/LICENSE
deleted file mode 100644
index 6b0b127..000
--- a/proton-c/bindings/javascript/LICENSE
+++ /dev/null
@@ -1,203 +0,0 @@
-
- Apache License
-   Version 2.0, January 2004
-http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-  "License" shall mean the terms and conditions for use, reproduction,
-  and distribution as defined by Sections 1 through 9 of this document.
-
-  "Licensor" shall mean the copyright owner or entity authorized by
-  the copyright owner that is granting the License.
-
-  "Legal Entity" shall mean the union of the acting entity and all
-  other entities that control, are controlled by, or are under common
-  control with that entity. For the purposes of this definition,
-  "control" means (i) the power, direct or indirect, to cause the
-  direction or management of such entity, whether by contract or
-  otherwise, or (ii) ownership of fifty percent (50%) or more of the
-  outstanding shares, or (iii) beneficial ownership of such entity.
-
-  "You" (or "Your") shall mean an individual or Legal Entity
-  exercising permissions granted by this License.
-
-  "Source" form shall mean the preferred form for making modifications,
-  including but not limited to software source code, documentation
-  source, and configuration files.
-
-  "Object" form shall mean any form resulting from mechanical
-  transformation or translation of a Source form, including but
-  not limited to compiled object code, generated documentation,
-  and conversions to other media types.
-
-  "Work" shall mean the work of authorship, whether in Source or
-  Object form, made available under the License, as indicated by a
-  copyright notice that is included in or attached to the work
-  (an example is provided in the Appendix below).
-
-  "Derivative Works" shall mean any work, whether in Source or Object
-  form, that is based on (or derived from) the Work and for which the
-  editorial revisions, annotations, elaborations, or other modifications
-  represent, as a whole, an original work of authorship. For the purposes
-  of this License, Derivative Works shall not include works that remain
-  separable from, or merely link (or bind by name) to the interfaces of,
-  the Work and Derivative Works thereof.
-
-  "Contribution" shall mean any work of authorship, including
-  the original version of the Work and any modifications or additions
-  to that Work or Derivative Works thereof, that is intentionally
-  submitted to Licensor for inclusion in the Work by the copyright owner
-  or by an individual or Legal Entity authorized to submit on behalf of
-  the copyright owner. For the purposes of this definition, "submitted"
-  means any form of electronic, verbal, or written communication sent
-  to the Licensor or its representatives, including but not limited to
-  communication on electronic mailing lists, source code control systems,
-  and issue tracking systems that are managed by, or on behalf of, the
-  Licensor for the purpose of discussing and improving the Work, but
-  excluding communication that is conspicuously marked or otherwise
-  designated in writing by the copyright owner as "Not a Contribution."
-
-  "Contributor" shall mean Licensor and any individual or Legal Entity
-  on behalf of whom a Contribution has been received by Licensor and
-  subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-  this License, each Contributor hereby grants to You a perpetual,
-  worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-  copyright license to reproduce, prepare Derivative Works of,
-  publicly display, publicly perform, sublicense, and distribute the
-  Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-  this License, each Contributor hereby grants to You a perpetual,
-  worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-  (except as stated in this section) patent license to make, have made,
-  use, offer to sell, sell, import, and otherwise transfer the Work,
-  where such license applies only to those patent claims licensable
-  by such Contributor that are necessarily infringed by their
-  Contribution(s) alone or by combination of their Contribution(s)
-  with the Work to which such 

[09/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/include/proton/url.h
--
diff --git a/proton-c/include/proton/url.h b/proton-c/include/proton/url.h
deleted file mode 100644
index e898aba..000
--- a/proton-c/include/proton/url.h
+++ /dev/null
@@ -1,129 +0,0 @@
-#ifndef PROTON_URL_H
-#define PROTON_URL_H 1
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- */
-
-#include 
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @file
- *
- * @copybrief url
- * @deprecated
- *
- * @addtogroup url
- * @{
- */
-
-/**
- * A parsed URL
- */
-typedef struct pn_url_t pn_url_t;
-
-/**
- * Create an empty URL
- */
-PNX_EXTERN pn_url_t *pn_url(void);
-
-/**
- * Parse a string URL as a pn_url_t.
- *
- * URL syntax:
- *
- * [  :// ] [  [ :  ] @ ]  [ :  ] [ / 
 ]
- *
- * `scheme`, `user`, `password`, `port` cannot contain any of '@', ':', '/'
- *
- * If the first character of `host` is '[' then it can contain any character up
- * to ']' (this is to allow IPv6 literal syntax). Otherwise it also cannot
- * contain '@', ':', '/'
- *
- * `path` can contain any character
- *
- * @param[in] url A URL string.
- * @return The parsed pn_url_t or NULL if url is not a valid URL string.
- */
-PNX_EXTERN pn_url_t *pn_url_parse(const char *url);
-
-/**
- * Free a URL */
-PNX_EXTERN void pn_url_free(pn_url_t *url);
-
-/**
- * Clear the contents of the URL.
- */
-PNX_EXTERN void pn_url_clear(pn_url_t *url);
-
-/**
- * Return the string form of a URL.
- *
- * The returned string is owned by the pn_url_t and will become
- * invalid if it is modified.
- */
-PNX_EXTERN const char *pn_url_str(pn_url_t *url);
-
-/**
- * @name Getters for parts of the URL.
- *
- * Values belong to the URL. May return NULL if the value is not set.
- *
- * @{
- */
-PNX_EXTERN const char *pn_url_get_scheme(pn_url_t *url);
-PNX_EXTERN const char *pn_url_get_username(pn_url_t *url);
-PNX_EXTERN const char *pn_url_get_password(pn_url_t *url);
-PNX_EXTERN const char *pn_url_get_host(pn_url_t *url);
-PNX_EXTERN const char *pn_url_get_port(pn_url_t *url);
-PNX_EXTERN const char *pn_url_get_path(pn_url_t *url);
-/**
- * @}
- */
-
-/**
- * @name Setters for parts of the URL.
- *
- * Values are copied. Value can be NULL to indicate the part is not
- * set.
- *
- * @{
- */
-PNX_EXTERN void pn_url_set_scheme(pn_url_t *url, const char *scheme);
-PNX_EXTERN void pn_url_set_username(pn_url_t *url, const char *username);
-PNX_EXTERN void pn_url_set_password(pn_url_t *url, const char *password);
-PNX_EXTERN void pn_url_set_host(pn_url_t *url, const char *host);
-PNX_EXTERN void pn_url_set_port(pn_url_t *url, const char *port);
-PNX_EXTERN void pn_url_set_path(pn_url_t *url, const char *path);
-/**
- * @}
- */
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* url.h */

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/include/proton/version.h.in
--
diff --git a/proton-c/include/proton/version.h.in 
b/proton-c/include/proton/version.h.in
deleted file mode 100644
index 133b0bb..000
--- a/proton-c/include/proton/version.h.in
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef _PROTON_VERSION_H
-#define _PROTON_VERSION_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- *
- */
-
-#define PN_VERSION_MAJOR @PN_VERSION_MAJOR@
-#define PN_VERSION_MINOR 

[37/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/bindings/cpp/include/proton/internal/pn_unique_ptr.hpp
--
diff --git a/proton-c/bindings/cpp/include/proton/internal/pn_unique_ptr.hpp 
b/proton-c/bindings/cpp/include/proton/internal/pn_unique_ptr.hpp
deleted file mode 100644
index 323c701..000
--- a/proton-c/bindings/cpp/include/proton/internal/pn_unique_ptr.hpp
+++ /dev/null
@@ -1,70 +0,0 @@
-#ifndef PROTON_INTERNAL_UNIQUE_PTR_HPP
-#define PROTON_INTERNAL_UNIQUE_PTR_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- *
- */
-
-#include "./config.hpp"
-
-#include 
-
-namespace proton {
-namespace internal {
-
-/// A simple unique ownership pointer, used as a return value from
-/// functions that transfer ownership to the caller.
-///
-/// pn_unique_ptr return values should be converted immediately to
-/// std::unique_ptr if that is available or std::auto_ptr (by calling
-/// release()) for older C++. You should not use pn_unique_ptr in your
-/// own code.  It is a limited pointer class designed only to work
-/// around differences between C++11 and C++03.
-template  class pn_unique_ptr {
-  public:
-pn_unique_ptr(T* p=0) : ptr_(p) {}
-#if PN_CPP_HAS_RVALUE_REFERENCES
-pn_unique_ptr(pn_unique_ptr&& x) : ptr_(0)  { std::swap(ptr_, x.ptr_); }
-#else
-pn_unique_ptr(const pn_unique_ptr& x) : ptr_() { std::swap(ptr_, 
const_cast(x).ptr_); }
-#endif
-~pn_unique_ptr() { delete(ptr_); }
-T& operator*() const { return *ptr_; }
-T* operator->() const { return ptr_; }
-T* get() const { return ptr_; }
-void reset(T* p = 0) { pn_unique_ptr tmp(p); std::swap(ptr_, tmp.ptr_); 
}
-T* release() { T *p = ptr_; ptr_ = 0; return p; }
-#if PN_CPP_HAS_EXPLICIT_CONVERSIONS
-explicit operator bool() const { return get(); }
-#endif
-bool operator !() const { return !get(); }
-
-#if PN_CPP_HAS_UNIQUE_PTR
-operator std::unique_ptr() { T *p = ptr_; ptr_ = 0; return 
std::unique_ptr(p); }
-#endif
-
-  private:
-T* ptr_;
-};
-
-} // internal
-} // proton
-
-#endif // PROTON_INTERNAL_UNIQUE_PTR_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/bindings/cpp/include/proton/internal/type_traits.hpp
--
diff --git a/proton-c/bindings/cpp/include/proton/internal/type_traits.hpp 
b/proton-c/bindings/cpp/include/proton/internal/type_traits.hpp
deleted file mode 100644
index 8abba55..000
--- a/proton-c/bindings/cpp/include/proton/internal/type_traits.hpp
+++ /dev/null
@@ -1,184 +0,0 @@
-#ifndef PROTON_INTERNAL_TYPE_TRAITS_HPP
-#define PROTON_INTERNAL_TYPE_TRAITS_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- *
- */
-
-// Type traits for mapping between AMQP and C++ types.
-//
-// Also provides workarounds for missing type_traits classes on older
-// C++ compilers.
-
-#include "./config.hpp"
-#include "../types_fwd.hpp"
-#include "../type_id.hpp"
-
-#include 
-
-#include 
-
-namespace proton {
-namespace internal {
-
-class decoder;
-class encoder;
-
-template  struct enable_if {};
-template  struct enable_if { typedef T type; };
-
-struct true_type { static const bool value = true; };
-struct false_type { static const bool value = false; };
-
-template  struct is_integral : public false_type {};
-template  struct 

[42/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/examples/perl/messenger/async.pm
--
diff --git a/examples/perl/messenger/async.pm b/examples/perl/messenger/async.pm
deleted file mode 100644
index 5cd350b..000
--- a/examples/perl/messenger/async.pm
+++ /dev/null
@@ -1,120 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you 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.
-#
-
-use qpid_proton;
-
-package async::CallbackAdapter;
-
-sub new {
-my ($class) = @_;
-my ($self) = {};
-
-my $messenger = $_[1];
-
-$self->{_messenger} = $messenger;
-$messenger->set_blocking(0);
-$messenger->set_incoming_window(1024);
-$messenger->set_outgoing_window(1024);
-
-my $message = qpid::proton::Message->new();
-$self->{_message} = $message;
-$self->{_incoming} = $message;
-$self->{_tracked} = {};
-
-bless $self, $class;
-return $self;
-}
-
-sub run {
-my ($self) = @_;
-
-$self->{_running} = 1;
-
-my $messenger = $self->{_messenger};
-
-$messenger->start();
-$self->on_start();
-
-do {
-$messenger->work;
-$self->process_outgoing;
-$self->process_incoming;
-} while($self->{_running});
-
-$messenger->stop();
-
-while(!$messenger->stopped()) {
-$messenger->work;
-$self->process_outgoing;
-$self->process_incoming;
-}
-
-$self->on_stop();
-}
-
-sub stop {
-my ($self) = @_;
-
-$self->{_running} = 0;
-}
-
-sub process_outgoing {
-my ($self) = @_;
-my $tracked = $self->{_tracked};
-
-foreach $key (keys %{$tracked}) {
-my $on_status = $tracked->{$key};
-if (defined($on_status)) {
-if (!($on_status eq qpid::proton::Tracker::PENDING)) {
-$self->$on_status($status);
-$self->{_messenger}->settle($t);
-# delete the settled item
-undef $tracked->{$key};
-}
-}
-}
-}
-
-sub process_incoming {
-my ($self) = @_;
-my $messenger = $self->{_messenger};
-
-while ($messenger->incoming > 0) {
-my $message = $self->{_message};
-my $t = $messenger->get($message);
-
-$self->on_receive($message);
-$messenger->accept($t);
-}
-}
-
-sub send {
-my ($self) = @_;
-my $messenger = $self->{_messenger};
-my $tracked = $self->{_tracked};
-my $message = $_[1];
-my $on_status = $_[2] || undef;
-
-my $tracker = $messenger->put($message);
-
-$tracked->{$tracker} = $on_status if (defined($on_status));
-}
-
-
-1;

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/examples/perl/messenger/client.pl
--
diff --git a/examples/perl/messenger/client.pl 
b/examples/perl/messenger/client.pl
deleted file mode 100755
index a6d8378..000
--- a/examples/perl/messenger/client.pl
+++ /dev/null
@@ -1,105 +0,0 @@
-#!/usr/bin/env perl
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you 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.
-#
-
-use strict;
-use warnings;
-use Getopt::Long;
-use Pod::Usage;
-
-use qpid_proton;
-
-my $reply_to = "~/replies";
-my $help = 0;
-my $man = 0;
-
-GetOptions(
-"reply_to=s", \$reply_to,
-man => \$man,
-"help|?" => \$help
-) or pod2usage(2);
-pod2usage(1) if $help;
-pod2usage(-exitval => 0, -verbose => 2) if $man;
-
-# get the address to use and show help if it's missing
-my $address = $ARGV[0];
-pod2usage(1) if !$address;
-

[50/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/config.bat.in
--
diff --git a/config.bat.in b/config.bat.in
deleted file mode 100644
index a73a88e..000
--- a/config.bat.in
+++ /dev/null
@@ -1,66 +0,0 @@
-REM
-REM Licensed to the Apache Software Foundation (ASF) under one
-REM or more contributor license agreements.  See the NOTICE file
-REM distributed with this work for additional information
-REM regarding copyright ownership.  The ASF licenses this file
-REM to you under the Apache License, Version 2.0 (the
-REM "License"); you may not use this file except in compliance
-REM with the License.  You may obtain a copy of the License at
-REM
-REM   http://www.apache.org/licenses/LICENSE-2.0
-REM
-REM Unless required by applicable law or agreed to in writing,
-REM software distributed under the License is distributed on an
-REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-REM KIND, either express or implied.  See the License for the
-REM specific language governing permissions and limitations
-REM under the License.
-REM
-
-REM This is a generated file and will be overwritten the next
-REM time that cmake is run.
-
-REM This build may be one of @CMAKE_CONFIGURATION_TYPES@
-REM Choose the configuration this script should reference:
-SET PROTON_BUILD_CONFIGURATION=relwithdebinfo
-
-REM PROTON_HOME  is the root of the proton checkout
-REM PROTON_BUILD is where cmake was run
-
-set PROTON_HOME=@CMAKE_SOURCE_DIR@
-set PROTON_BUILD=@CMAKE_BINARY_DIR@
-
-set PROTON_HOME=%PROTON_HOME:/=\%
-set PROTON_BUILD=%PROTON_BUILD:/=\%
-
-set PROTON_BINDINGS=%PROTON_BUILD%\proton-c\bindings
-set PROTON_JARS=%PROTON_BUILD%\proton-j\proton-j.jar
-
-REM Python & Jython
-set PYTHON_BINDINGS=%PROTON_BINDINGS%\python
-set 
COMMON_PYPATH=%PROTON_HOME%\tests\python;%PROTON_HOME%\proton-c\bindings\python
-set PYTHONPATH=%COMMON_PYPATH%;%PYTHON_BINDINGS%
-set 
JYTHONPATH=%COMMON_PYPATH%;%PROTON_HOME%\proton-j\src\main\resources;%PROTON_JARS%
-set CLASSPATH=%PROTON_JARS%
-
-REM PHP
-set PHP_BINDINGS=%PROTON_BINDINGS%\php
-if EXIST %PHP_BINDINGS% (
-echo include_path="%PHP_BINDINGS%;%PROTON_HOME%\proton-c\bindings\php" >  
%PHP_BINDINGS%\php.ini
-echo extension="%PHP_BINDINGS%\cproton.so" >> 
%PHP_BINDINGS%\php.ini
-set PHPRC=%PHP_BINDINGS%\php.ini
-)
-
-REM Ruby
-set RUBY_BINDINGS=%PROTON_BINDINGS%\ruby
-set 
RUBYLIB=%RUBY_BINDINGS%;%PROTON_HOME%\proton-c\bindings\ruby\lib;%PROTON_HOME%\tests\ruby
-
-REM Perl
-set PERL_BINDINGS=%PROTON_BINDINGS%\perl
-set 
PERL5LIB=%PERL5LIB%;%PERL_BINDINGS%;%PROTON_HOME%\proton-c\bindings\perl\lib
-
-REM test applications
-set PATH=%PATH%;%PROTON_BUILD%\tests\tools\apps\c
-set PATH=%PATH%;%PROTON_HOME%\tests\tools\apps\python
-set PATH=%PATH%;%PROTON_HOME%\tests\python
-set PATH=%PATH%;%PROTON_BUILD%\proton-c\%PROTON_BUILD_CONFIGURATION%

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/config.sh.in
--
diff --git a/config.sh.in b/config.sh.in
deleted file mode 100755
index edb77e6..000
--- a/config.sh.in
+++ /dev/null
@@ -1,86 +0,0 @@
-#!/bin/bash
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you 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.
-#
-
-merge_paths() {
-# Merge paths, remove duplicates (keep first instance)
-path=$(echo $* | sed 's/:/ /'g) # Split with spaces.
-newpath=""
-for d in $path; do # Remove duplicates
-   { echo $newpath | grep -q "\(:\|^\)$d\(:\|$\)"; } || 
newpath="$newpath:$d"
-done
-echo $newpath | sed 's/^://' # Remove leading :
-}
-
-PROTON_HOME=@CMAKE_SOURCE_DIR@
-PROTON_BUILD=@CMAKE_BINARY_DIR@
-
-PROTON_BINDINGS=$PROTON_BUILD/proton-c/bindings
-PROTON_JARS=$PROTON_BUILD/proton-j/proton-j.jar
-
-PYTHON_BINDINGS=$PROTON_BINDINGS/python
-PHP_BINDINGS=$PROTON_BINDINGS/php
-RUBY_BINDINGS=$PROTON_BINDINGS/ruby
-PERL_BINDINGS=$PROTON_BINDINGS/perl
-
-# Python & Jython
-COMMON_PYPATH=$PROTON_HOME/tests/python:$PROTON_HOME/proton-c/bindings/python:$PROTON_HOME/examples
-export PYTHONPATH=$COMMON_PYPATH:$PYTHON_BINDINGS
-export 
JYTHONPATH=$COMMON_PYPATH:$PROTON_HOME/proton-j/src/main/resources:$PROTON_JARS
-export 

[18/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/bindings/ruby/lib/core/delivery.rb
--
diff --git a/proton-c/bindings/ruby/lib/core/delivery.rb 
b/proton-c/bindings/ruby/lib/core/delivery.rb
deleted file mode 100644
index 5c0b25c..000
--- a/proton-c/bindings/ruby/lib/core/delivery.rb
+++ /dev/null
@@ -1,271 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you 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.
-#++
-
-module Qpid::Proton
-
-  # A Delivery maintains detail on the delivery of data to an endpoint.
-  #
-  # A Delivery has a single parent Qpid::Proton::Link
-  #
-  # @example
-  #
-  #   # SCENARIO: An event comes in notifying that data has been delivered to
-  #   #   the local endpoint. A Delivery object can be used to check
-  #   #   the details of the delivery.
-  #
-  #   delivery = @event.delivery
-  #   if delivery.readable? && !delivery.partial?
-  # # decode the incoming message
-  # msg = Qpid::Proton::Message.new
-  # msg.decode(link.receive(delivery.pending))
-  #   end
-  #
-  class Delivery
-
-# @private
-include Util::Wrapper
-
-# @private
-def self.wrap(impl) # :nodoc:
-  return nil if impl.nil?
-  self.fetch_instance(impl, :pn_delivery_attachments) || Delivery.new(impl)
-end
-
-# @private
-def initialize(impl)
-  @impl = impl
-  @local = Disposition.new(Cproton.pn_delivery_local(impl), true)
-  @remote = Disposition.new(Cproton.pn_delivery_remote(impl), false)
-  self.class.store_instance(self, :pn_delivery_attachments)
-end
-
-# @private
-include Util::SwigHelper
-
-# @private
-PROTON_METHOD_PREFIX = "pn_delivery"
-
-# @!attribute [r] tag
-#
-# @return [String] The tag for the delivery.
-#
-proton_caller :tag
-
-# @!attribute [r] writable?
-#
-# A delivery is considered writable if it is the current delivery on an
-# outgoing link, and the link has positive credit.
-#
-# @return [Boolean] Returns if a delivery is writable.
-#
-proton_caller :writable?
-
-# @!attribute [r] readable?
-#
-# A delivery is considered readable if it is the current delivery on an
-# incoming link.
-#
-# @return [Boolean] Returns if a delivery is readable.
-#
-proton_caller :readable?
-# @!attribute [r] updated?
-#
-# A delivery is considered updated whenever the peer communicates a new
-# disposition for the dlievery. Once a delivery becomes updated, it will
-# remain so until cleared.
-#
-# @return [Boolean] Returns if a delivery is updated.
-#
-# @see #clear
-#
-proton_caller :updated?
-
-# @!method clear
-#
-# Clear the updated flag for a delivery.
-#
-proton_caller :clear
-
-# @!attribute [r] pending
-#
-# @return [Fixnum] Return the amount of pending message data for the
-# delivery.
-#
-proton_caller :pending
-
-# @!attribute [r] partial?
-#
-# @return [Boolean] Returns if the delivery has only partial message data.
-#
-proton_caller :partial?
-
-# @!attribute [r] settled?
-#
-# @return [Boolean] Returns if the delivery is remotely settled.
-#
-proton_caller :settled?
-
-
-# @!method settle
-#
-# Settles a delivery.
-#
-#  A settled delivery can never be used again.
-#
-proton_caller :settle
-
-# @!method dump
-#
-#  Utility function for printing details of a delivery.
-#
-proton_caller :dump
-
-# @!attribute [r] buffered?
-#
-# A delivery that is buffered has not yet been written to the wire.
-#
-# Note that returning false does not imply that a delivery was definitely
-# written to the wire. If false is returned, it is not known whether the
-# delivery was actually written to the wire or not.
-#
-# @return [Boolean] Returns if the delivery is buffered.
-#
-proton_caller :buffered?
-
-include Util::Engine
-
-def update(state)
-  impl = @local.impl
-  object_to_data(@local.data, Cproton.pn_disposition_data(impl))
-  object_to_data(@local.annotations, 

[22/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/bindings/python/docs/tutorial.rst
--
diff --git a/proton-c/bindings/python/docs/tutorial.rst 
b/proton-c/bindings/python/docs/tutorial.rst
deleted file mode 100644
index ee8a12f..000
--- a/proton-c/bindings/python/docs/tutorial.rst
+++ /dev/null
@@ -1,301 +0,0 @@
-
-Tutorial
-
-
-
-Hello World!
-
-
-Tradition dictates that we start with hello world! However rather than
-simply striving for the shortest program possible, we'll aim for a
-more illustrative example while still restricting the functionality to
-sending and receiving a single message.
-
-.. literalinclude:: ../../../../examples/python/helloworld.py
-   :lines: 21-
-   :linenos:
-
-You can see the import of :py:class:`~proton.reactor.Container` from 
``proton.reactor`` on the
-second line. This is a class that makes programming with proton a
-little easier for the common cases. It includes within it an event
-loop, and programs written using this utility are generally structured
-to react to various events. This reactive style is particularly suited
-to messaging applications.
-
-To be notified of a particular event, you define a class with the
-appropriately name method on it. That method is then called by the
-event loop when the event occurs.
-
-We define a class here, ``HelloWorld``, which handles the key events of
-interest in sending and receiving a message.
-
-The ``on_start()`` method is called when the event loop first
-starts. We handle that by establishing our connection (line 12), a
-sender over which to send the message (line 13) and a receiver over
-which to receive it back again (line 14).
-
-The ``on_sendable()`` method is called when message can be transferred
-over the associated sender link to the remote peer. We send out our
-``Hello World!`` message (line 17), then close the sender (line 18) as
-we only want to send one message. The closing of the sender will
-prevent further calls to ``on_sendable()``.
-
-The ``on_message()`` method is called when a message is
-received. Within that we simply print the body of the message (line
-21) and then close the connection (line 22).
-
-Now that we have defined the logic for handling these events, we
-create an instance of a :py:class:`~proton.reactor.Container`, pass it
-our handler and then enter the event loop by calling
-:py:meth:`~proton.reactor.Container.run()`. At this point control
-passes to the container instance, which will make the appropriate
-callbacks to any defined handlers.
-
-To run the example you will need to have a broker (or similar)
-accepting connections on that url either with a queue (or topic)
-matching the given address or else configured to create such a queue
-(or topic) dynamically. There is a simple broker.py script included
-alongside the examples that can be used for this purpose if
-desired. (It is also written using the API described here, and as such
-gives an example of a slightly more involved application).
-
-
-Hello World, Direct!
-
-
-Though often used in conjunction with a broker, AMQP does not
-*require* this. It also allows senders and receivers can communicate
-directly if desired.
-
-Let's modify our example to demonstrate this.
-
-.. literalinclude:: ../../../../examples/python/helloworld_direct.py
-   :lines: 21-
-   :emphasize-lines: 11,21-22,24-25
-   :linenos:
-
-The first difference, on line 11, is that rather than creating a
-receiver on the same connection as our sender, we listen for incoming
-connections by invoking the
-:py:meth:`~proton.reactor.Container.listen()` method on the
-container.
-
-As we only need then to initiate one link, the sender, we can do that
-by passing in a url rather than an existing connection, and the
-connection will also be automatically established for us.
-
-We send the message in response to the ``on_sendable()`` callback and
-print the message out in response to the ``on_message()`` callback
-exactly as before.
-
-However we also handle two new events. We now close the connection
-from the senders side once the message has been accepted (line
-22). The acceptance of the message is an indication of successful
-transfer to the peer. We are notified of that event through the
-``on_accepted()`` callback. Then, once the connection has been closed,
-of which we are notified through the ``on_closed()`` callback, we stop
-accepting incoming connections (line 25) at which point there is no
-work to be done and the event loop exits, and the run() method will
-return.
-
-So now we have our example working without a broker involved!
-
-=
-Asynchronous Send and Receive
-=
-
-Of course, these ``HelloWorld!`` examples are very artificial,
-communicating as they do over a network connection but with the same
-process. A more 

[39/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/CMakeLists.txt
--
diff --git a/proton-c/CMakeLists.txt b/proton-c/CMakeLists.txt
deleted file mode 100644
index 5f26d43..000
--- a/proton-c/CMakeLists.txt
+++ /dev/null
@@ -1,751 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you 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.
-#
-
-include(CheckLibraryExists)
-include(CheckSymbolExists)
-
-include(soversion.cmake)
-
-add_custom_target(docs)
-add_custom_target(doc DEPENDS docs)
-
-# Set the default SSL/TLS implementation
-find_package(OpenSSL)
-find_package(PythonInterp REQUIRED)
-find_package(SWIG)
-# FindSwig.cmake "forgets" make its outputs advanced like a good citizen
-mark_as_advanced(SWIG_DIR SWIG_EXECUTABLE SWIG_VERSION)
-
-# See if Cyrus SASL is available
-find_library(CYRUS_SASL_LIBRARY sasl2)
-find_path(CYRUS_SASL_INCLUDE_DIR sasl/sasl.h PATH_SUFFIXES include)
-find_package_handle_standard_args(CyrusSASL DEFAULT_MSG CYRUS_SASL_LIBRARY 
CYRUS_SASL_INCLUDE_DIR)
-mark_as_advanced(CYRUS_SASL_LIBRARY CYRUS_SASL_INCLUDE_DIR)
-
-# Find saslpasswd2 executable to generate test config
-find_program(SASLPASSWD_EXE saslpasswd2 DOC "Program used to make SASL user db 
for testing")
-mark_as_advanced(SASLPASSWD_EXE)
-
-if(WIN32 AND NOT CYGWIN)
-  # linking against Windows native libraries, including mingw
-  set (PN_WINAPI TRUE)
-endif(WIN32 AND NOT CYGWIN)
-
-set(ssl_impl, none)
-if(PN_WINAPI)
-  set(ssl_impl schannel)
-  set(ssl_providers "'none','schannel','openssl'")
-else(PN_WINAPI)
-  if (OPENSSL_FOUND)
-set(ssl_impl openssl)
-  endif (OPENSSL_FOUND)
-  set(ssl_providers "'none','openssl'")
-endif(PN_WINAPI)
-set(SSL_IMPL ${ssl_impl} CACHE STRING "Library to use for SSL/TLS support. 
Valid values: ${ssl_providers}")
-
-set(sasl_providers cyrus none)
-if (CYRUSSASL_FOUND)
-  set (sasl_impl cyrus)
-else ()
-  set (sasl_impl none)
-endif ()
-set(SASL_IMPL ${sasl_impl} CACHE STRING "Library to use for SASL support. 
Valid values: ${sasl_providers}")
-
-configure_file (
-  "${CMAKE_CURRENT_SOURCE_DIR}/include/proton/version.h.in"
-  "${CMAKE_CURRENT_BINARY_DIR}/include/proton/version.h"
-  )
-
-include_directories ("${CMAKE_CURRENT_BINARY_DIR}/src")
-include_directories ("${CMAKE_CURRENT_BINARY_DIR}/include")
-include_directories ("${CMAKE_CURRENT_SOURCE_DIR}/src")
-include_directories ("${CMAKE_CURRENT_SOURCE_DIR}/include")
-
-set (env_py ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/env.py)
-
-add_custom_command (
-  OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/src/encodings.h
-  COMMAND ${env_py} PYTHONPATH=${CMAKE_CURRENT_SOURCE_DIR} 
${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/src/encodings.h.py > 
${CMAKE_CURRENT_BINARY_DIR}/src/encodings.h
-  DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/encodings.h.py
-  )
-
-add_custom_command (
-  OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/src/protocol.h
-  COMMAND ${env_py} PYTHONPATH=${CMAKE_CURRENT_SOURCE_DIR} 
${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/src/protocol.h.py > 
${CMAKE_CURRENT_BINARY_DIR}/src/protocol.h
-  DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/protocol.h.py
-  )
-
-add_custom_target(
-  generated_c_files
-  DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/src/protocol.h 
${CMAKE_CURRENT_BINARY_DIR}/src/encodings.h
-  )
-
-# Select IO impl
-if(PN_WINAPI)
-  set (pn_io_impl src/reactor/io/windows/io.c src/reactor/io/windows/iocp.c 
src/reactor/io/windows/write_pipeline.c)
-  set (pn_selector_impl src/reactor/io/windows/selector.c)
-else(PN_WINAPI)
-  set (pn_io_impl src/reactor/io/posix/io.c)
-  set (pn_selector_impl src/reactor/io/posix/selector.c)
-endif(PN_WINAPI)
-
-# Link in SASL if present
-if (SASL_IMPL STREQUAL cyrus)
-  set(pn_sasl_impl src/sasl/sasl.c src/sasl/cyrus_sasl.c)
-  include_directories (${CYRUS_SASL_INCLUDE_DIR})
-  set(SASL_LIB ${CYRUS_SASL_LIBRARY} -lpthread)
-elseif (SASL_IMPL STREQUAL none)
-  set(pn_sasl_impl src/sasl/sasl.c src/sasl/none_sasl.c)
-endif ()
-
-# Set Compiler extra flags for Solaris when using SunStudio
-if(CMAKE_CXX_COMPILER_ID STREQUAL "SunPro" )
-set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mt" )
-endif()
-
-if(CMAKE_C_COMPILER_ID STREQUAL "SunPro" )
-  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mt")
-endif()
-
-# Link in openssl if 

[02/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/src/messenger/messenger.c
--
diff --git a/proton-c/src/messenger/messenger.c 
b/proton-c/src/messenger/messenger.c
deleted file mode 100644
index 264a733..000
--- a/proton-c/src/messenger/messenger.c
+++ /dev/null
@@ -1,2438 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- *
- */
-
-#include 
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include "core/log_private.h"
-#include "core/util.h"
-#include "platform/platform.h" // pn_i_getpid, pn_i_now, pni_snprintf
-#include "platform/platform_fmt.h"
-#include "store.h"
-#include "subscription.h"
-#include "transform.h"
-
-#include "reactor/io.h"
-#include "reactor/selectable.h"
-#include "reactor/selector.h"
-
-typedef struct pn_link_ctx_t pn_link_ctx_t;
-
-typedef struct {
-  pn_string_t *text;
-  bool passive;
-  char *scheme;
-  char *user;
-  char *pass;
-  char *host;
-  char *port;
-  char *name;
-} pn_address_t;
-
-// algorithm for granting credit to receivers
-typedef enum {
-  // pn_messenger_recv( X ), where:
-  LINK_CREDIT_EXPLICIT, // X > 0
-  LINK_CREDIT_AUTO, // X == -1
-  LINK_CREDIT_MANUAL// X == -2
-} pn_link_credit_mode_t;
-
-struct pn_messenger_t {
-  pn_address_t address;
-  char *name;
-  char *certificate;
-  char *private_key;
-  char *password;
-  char *trusted_certificates;
-  pn_io_t *io;
-  pn_list_t *pending; // pending selectables
-  pn_selectable_t *interruptor;
-  pn_socket_t ctrl[2];
-  pn_list_t *listeners;
-  pn_list_t *connections;
-  pn_selector_t *selector;
-  pn_collector_t *collector;
-  pn_list_t *credited;
-  pn_list_t *blocked;
-  pn_timestamp_t next_drain;
-  uint64_t next_tag;
-  pni_store_t *outgoing;
-  pni_store_t *incoming;
-  pn_list_t *subscriptions;
-  pn_subscription_t *incoming_subscription;
-  pn_error_t *error;
-  pn_transform_t *routes;
-  pn_transform_t *rewrites;
-  pn_tracker_t outgoing_tracker;
-  pn_tracker_t incoming_tracker;
-  pn_string_t *original;
-  pn_string_t *rewritten;
-  pn_string_t *domain;
-  int timeout;
-  int send_threshold;
-  pn_link_credit_mode_t credit_mode;
-  int credit_batch;  // when LINK_CREDIT_AUTO
-  int credit;// available
-  int distributed;   // credit
-  int receivers; // # receiver links
-  int draining;  // # links in drain state
-  int connection_error;
-  int flags;
-  int snd_settle_mode;  /* pn_snd_settle_mode_t or -1 for unset */
-  pn_rcv_settle_mode_t rcv_settle_mode;
-  pn_tracer_t tracer;
-  pn_ssl_verify_mode_t ssl_peer_authentication_mode;
-  bool blocking;
-  bool passive;
-  bool interrupted;
-  bool worked;
-};
-
-#define CTX_HEAD\
-  pn_messenger_t *messenger;\
-  pn_selectable_t *selectable;  \
-  bool pending;
-
-typedef struct pn_ctx_t {
-  CTX_HEAD
-} pn_ctx_t;
-
-typedef struct {
-  CTX_HEAD
-  char *host;
-  char *port;
-  pn_subscription_t *subscription;
-  pn_ssl_domain_t *domain;
-} pn_listener_ctx_t;
-
-typedef struct {
-  CTX_HEAD
-  pn_connection_t *connection;
-  char *address;
-  char *scheme;
-  char *user;
-  char *pass;
-  char *host;
-  char *port;
-  pn_listener_ctx_t *listener;
-} pn_connection_ctx_t;
-
-static pn_connection_ctx_t *pni_context(pn_selectable_t *sel)
-{
-  assert(sel);
-  pn_connection_ctx_t *ctx = (pn_connection_ctx_t *) 
pni_selectable_get_context(sel);
-  assert(ctx);
-  return ctx;
-}
-
-static pn_transport_t *pni_transport(pn_selectable_t *sel)
-{
-  return pn_connection_transport(pni_context(sel)->connection);
-}
-
-static ssize_t pni_connection_capacity(pn_selectable_t *sel)
-{
-  pn_transport_t *transport = pni_transport(sel);
-  ssize_t capacity = pn_transport_capacity(transport);
-  if (capacity < 0) {
-if (pn_transport_closed(transport)) {
-  pn_selectable_terminate(sel);
-}
-  }
-  return capacity;
-}
-
-bool pn_messenger_flow(pn_messenger_t *messenger);
-
-static ssize_t pni_connection_pending(pn_selectable_t *sel)
-{
-  pn_connection_ctx_t *ctx = pni_context(sel);
-  

[54/55] qpid-proton-j git commit: PROTON-1362: remove previously-deprecated Messenger

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2afe2ec0/proton-j/src/main/java/org/apache/qpid/proton/messenger/Tracker.java
--
diff --git 
a/proton-j/src/main/java/org/apache/qpid/proton/messenger/Tracker.java 
b/proton-j/src/main/java/org/apache/qpid/proton/messenger/Tracker.java
deleted file mode 100644
index 974b1b6..000
--- a/proton-j/src/main/java/org/apache/qpid/proton/messenger/Tracker.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.apache.qpid.proton.messenger;
-
-/**
- * @deprecated Messenger will be removed from upcoming proton-j releases.
- */
-@Deprecated
-public interface Tracker { }
-

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2afe2ec0/proton-j/src/main/java/org/apache/qpid/proton/messenger/impl/Address.java
--
diff --git 
a/proton-j/src/main/java/org/apache/qpid/proton/messenger/impl/Address.java 
b/proton-j/src/main/java/org/apache/qpid/proton/messenger/impl/Address.java
deleted file mode 100644
index 27b0d39..000
--- a/proton-j/src/main/java/org/apache/qpid/proton/messenger/impl/Address.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.apache.qpid.proton.messenger.impl;
-
-
-/**
- * Address
- *
- * @deprecated Messenger will be removed from upcoming proton-j releases.
- */
-public class Address
-{
-
-private String _address;
-private boolean _passive;
-private String _scheme;
-private String _user;
-private String _pass;
-private String _host;
-private String _port;
-private String _name;
-
-public void clear()
-{
-_passive = false;
-_scheme = null;
-_user = null;
-_pass = null;
-_host = null;
-_port = null;
-_name = null;
-}
-
-/**
- * @deprecated Messenger will be removed from upcoming proton-j releases.
- */
-public Address()
-{
-clear();
-}
-
-/**
- * @deprecated Messenger will be removed from upcoming proton-j releases.
- */
-public Address(String address)
-{
-clear();
-int start = 0;
-int schemeEnd = address.indexOf("://", start);
-if (schemeEnd >= 0) {
-_scheme = address.substring(start, schemeEnd);
-start = schemeEnd + 3;
-}
-
-String uphp;
-int slash = address.indexOf("/", start);
-if (slash >= 0) {
-uphp = address.substring(start, slash);
-_name = address.substring(slash + 1);
-} else {
-uphp = address.substring(start);
-}
-
-String hp;
-int at = uphp.indexOf('@');
-if (at >= 0) {
-String up = uphp.substring(0, at);
-hp = uphp.substring(at + 1);
-
-int colon = up.indexOf(':');
-if (colon >= 0) {
-_user = up.substring(0, colon);
-_pass = up.substring(colon + 1);
-} else {
-_user = up;
-}
-} else {
-hp = uphp;
-}
-
-if (hp.startsWith("[")) {
-int close = hp.indexOf(']');
-if (close >= 0) {
-_host = hp.substring(1, close);
-if (hp.substring(close + 

[24/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/bindings/perl/lib/qpid/proton/Message.pm
--
diff --git a/proton-c/bindings/perl/lib/qpid/proton/Message.pm 
b/proton-c/bindings/perl/lib/qpid/proton/Message.pm
deleted file mode 100644
index 0251b89..000
--- a/proton-c/bindings/perl/lib/qpid/proton/Message.pm
+++ /dev/null
@@ -1,538 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you 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 qpid::proton::Message;
-
-our $DATA_FORMAT = $cproton_perl::PN_DATA;
-our $TEXT_FORMAT = $cproton_perl::PN_TEXT;
-our $AMQP_FORMAT = $cproton_perl::PN_AMQP;
-our $JSON_FORMAT = $cproton_perl::PN_JSON;
-
-sub new {
-my ($class) = @_;
-my ($self) = {};
-
-my $impl = cproton_perl::pn_message();
-$self->{_impl} = $impl;
-$self->{_properties} = {};
-$self->{_instructions} = {};
-$self->{_annotations} = {};
-$self->{_body} = undef;
-$self->{_body_type} = undef;
-
-bless $self, $class;
-return $self;
-}
-
-use overload fallback => 1,
-'""' => sub {
-my ($self) = @_;
-my $tmp = cproton_perl::pn_string("");
-cproton_perl::pn_inspect($self->{_impl}, $tmp);
-my $result = cproton_perl::pn_string_get($tmp);
-cproton_perl::pn_free($tmp);
-return $result;
-};
-
-sub DESTROY {
-my ($self) = @_;
-my $impl = $self->{_impl};
-
-cproton_perl::pn_message_free($impl);
-}
-
-sub get_impl {
-my ($self) = @_;
-my $impl = $self->{_impl};
-return $impl;
-}
-
-sub clear {
-my ($self) = @_;
-my $impl = $self->{_impl};
-
-cproton_perl::pn_message_clear($impl);
-
-$self->{_body} = undef;
-$self->{_properties} = {};
-$self->{_instructions} = {};
-$self->{_annotations} = {};
-}
-
-sub errno {
-my ($self) = @_;
-return cproton_perl::pn_message_errno($self->{_impl});
-}
-
-sub error {
-my ($self) = @_;
-return cproton_perl::pn_message_error($self->{_impl});
-}
-
-sub set_durable {
-my ($self) = @_;
-cproton_perl::pn_message_set_durable($self->{_impl}, $_[1]);
-}
-
-sub get_durable {
-my ($self) = @_;
-return cproton_perl::pn_message_is_durable($self->{_impl});
-}
-
-sub set_priority {
-my ($self) = @_;
-cproton_perl::pn_message_set_priority($self->{_impl}, $_[1]);
-}
-
-sub get_priority {
-my ($self) = @_;
-return cproton_perl::pn_message_get_priority($self->{_impl});
-}
-
-sub set_ttl {
-my ($self) = @_;
-cproton_perl::pn_message_set_ttl($self->{_impl}, $_[1]);
-}
-
-sub get_ttl {
-my ($self) = @_;
-return cproton_perl::pn_message_get_ttl($self->{_impl});
-}
-
-sub set_first_acquirer {
-my ($self) = @_;
-cproton_perl::pn_message_set_first_acquirer($self->{_impl}, $_[1]);
-}
-
-sub get_first_acquirer {
-my ($self) = @_;
-return cproton_perl::pn_message_is_first_acquirer($self->{_impl});
-}
-
-sub set_delivery_count {
-my ($self) = @_;
-cproton_perl::pn_message_set_delivery_count($self->{_impl}, $_[1]);
-}
-
-sub get_delivery_count {
-my ($self) = @_;
-return cproton_perl::pn_message_get_delivery_count($self->{_impl});
-}
-
-sub set_id {
-my ($self) = @_;
-my $id = $_[1];
-
-die "Message id must be defined" if !defined($id);
-
-cproton_perl::pn_message_set_id($self->{_impl}, $id);
-}
-
-sub get_id {
-my ($self) = @_;
-my $id = cproton_perl::pn_message_get_id($self->{_impl});
-
-return $id;
-}
-
-sub set_user_id {
-my ($self) = @_;
-my $user_id = $_[1];
-
-die "User id must be defined" if !defined($user_id);
-
-cproton_perl::pn_message_set_user_id($self->{_impl}, $user_id);
-}
-
-sub get_user_id {
-my ($self) = @_;
-my $user_id = cproton_perl::pn_message_get_user_id($self->{_impl});
-
-return $user_id;
-}
-
-sub set_address {
-my ($self) = @_;
-cproton_perl::pn_message_set_address($self->{_impl}, $_[1]);
-}
-
-sub get_address {
-my ($self) = @_;
-return cproton_perl::pn_message_get_address($self->{_impl});
-}
-
-sub set_subject {
-my ($self) = @_;
-cproton_perl::pn_message_set_subject($self->{_impl}, $_[1]);
-}
-
-sub get_subject {
-my ($self) = @_;
-return 

[04/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/src/core/transport.c
--
diff --git a/proton-c/src/core/transport.c b/proton-c/src/core/transport.c
deleted file mode 100644
index 444145a..000
--- a/proton-c/src/core/transport.c
+++ /dev/null
@@ -1,3024 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- *
- */
-
-#include "engine-internal.h"
-#include "framing.h"
-#include "platform/platform.h"
-#include "platform/platform_fmt.h"
-#include "sasl/sasl-internal.h"
-#include "ssl/ssl-internal.h"
-
-#include "autodetect.h"
-#include "protocol.h"
-#include "dispatch_actions.h"
-#include "config.h"
-#include "log_private.h"
-
-#include "proton/event.h"
-
-#include 
-#include 
-#include 
-#include 
-#include 
-
-static ssize_t transport_consume(pn_transport_t *transport);
-
-// delivery buffers
-
-/*
- * Call this any time anything happens that may affect channel_max:
- * i.e. when the app indicates a preference, or when we receive the
- * OPEN frame from the remote peer.  And call it to do the final
- * calculation just before we communicate our limit to the remote
- * peer by sending our OPEN frame.
- */
-static void pni_calculate_channel_max(pn_transport_t *transport) {
-  /*
-   * The application cannot make the limit larger than
-   * what this library will allow.
-   */
-  transport->channel_max = (PN_IMPL_CHANNEL_MAX < transport->local_channel_max)
-   ? PN_IMPL_CHANNEL_MAX
-   : transport->local_channel_max;
-
-  /*
-   * The remote peer's constraint is not valid until the
-   * peer's open frame has been received.
-   */
-  if(transport->open_rcvd) {
-transport->channel_max = (transport->channel_max < 
transport->remote_channel_max)
- ? transport->channel_max
- : transport->remote_channel_max;
-  }
-}
-
-void pn_delivery_map_init(pn_delivery_map_t *db, pn_sequence_t next)
-{
-  db->deliveries = pn_hash(PN_WEAKREF, 0, 0.75);
-  db->next = next;
-}
-
-void pn_delivery_map_free(pn_delivery_map_t *db)
-{
-  pn_free(db->deliveries);
-}
-
-static pn_delivery_t *pni_delivery_map_get(pn_delivery_map_t *db, 
pn_sequence_t id)
-{
-  return (pn_delivery_t *) pn_hash_get(db->deliveries, id);
-}
-
-static void pn_delivery_state_init(pn_delivery_state_t *ds, pn_delivery_t 
*delivery, pn_sequence_t id)
-{
-  ds->id = id;
-  ds->sent = false;
-  ds->init = true;
-}
-
-static pn_delivery_state_t *pni_delivery_map_push(pn_delivery_map_t *db, 
pn_delivery_t *delivery)
-{
-  pn_delivery_state_t *ds = >state;
-  pn_delivery_state_init(ds, delivery, db->next++);
-  pn_hash_put(db->deliveries, ds->id, delivery);
-  return ds;
-}
-
-void pn_delivery_map_del(pn_delivery_map_t *db, pn_delivery_t *delivery)
-{
-  if (delivery->state.init) {
-delivery->state.init = false;
-delivery->state.sent = false;
-pn_hash_del(db->deliveries, delivery->state.id);
-  }
-}
-
-static void pni_delivery_map_clear(pn_delivery_map_t *dm)
-{
-  pn_hash_t *hash = dm->deliveries;
-  for (pn_handle_t entry = pn_hash_head(hash);
-   entry;
-   entry = pn_hash_next(hash, entry))
-  {
-pn_delivery_t *dlv = (pn_delivery_t *) pn_hash_value(hash, entry);
-pn_delivery_map_del(dm, dlv);
-  }
-  dm->next = 0;
-}
-
-static void pni_default_tracer(pn_transport_t *transport, const char *message)
-{
-  fprintf(stderr, "[%p]:%s\n", (void *) transport, message);
-}
-
-static ssize_t pn_io_layer_input_passthru(pn_transport_t *, unsigned int, 
const char *, size_t );
-static ssize_t pn_io_layer_output_passthru(pn_transport_t *, unsigned int, 
char *, size_t );
-
-static ssize_t pn_io_layer_input_error(pn_transport_t *, unsigned int, const 
char *, size_t );
-static ssize_t pn_io_layer_output_error(pn_transport_t *, unsigned int, char 
*, size_t );
-
-static ssize_t pn_io_layer_input_setup(pn_transport_t *transport, unsigned int 
layer, const char *bytes, size_t available);
-static ssize_t pn_io_layer_output_setup(pn_transport_t *transport, unsigned 
int layer, char *bytes, size_t available);
-
-static ssize_t pn_input_read_amqp_header(pn_transport_t *transport, unsigned 

[43/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/examples/javascript/messenger/qpid-config.js
--
diff --git a/examples/javascript/messenger/qpid-config.js 
b/examples/javascript/messenger/qpid-config.js
deleted file mode 100755
index cf7201b..000
--- a/examples/javascript/messenger/qpid-config.js
+++ /dev/null
@@ -1,1511 +0,0 @@
-#!/usr/bin/env node
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- *
- */
-
-/**
- * Port of qpid-config to JavaScript for Node.js, mainly intended as a demo to
- * illustrate using QMF2 in JavaScript using the proton.Messenger JS binding.
- * It illustrates a few things including how to use Messenger completely
- * asynchronously including using an async request/response pattern with
- * correlation IDs. It also proves interoperability of AMQP Map, List etc.
- * between C++ and JavaScript as QMF2 is pretty much all about Lists of Maps.
- * 
- * The actual QMF2 code is pretty simple as we're just doing a basic getObjects
- * it's made all the simpler because we can use JavaScript object literals as
- * the JavaScript binding serialises and deserialises directly between 
JavaScript
- * Objects and Lists and the AMQP type system so something that can be quite
- * involved in languages like C++ and Java becomes quite simple in JavaScript,
- * though the asynchronous nature of JavaScript provides its own opportunities
- * for complication best illustrated by the need for the correlator object.
- */
-
-// Check if the environment is Node.js and if not log an error and exit.
-if (typeof process === 'object' && typeof require === 'function') {
-
-var qmf = {}; // Create qmf namespace object.
-qmf.Console = function() { // qmf.Console Constructor.
-var proton = require("qpid-proton-messenger");
-var message = new proton.Message();
-var messenger = new proton.Messenger();
-
-var brokerAddress = '';
-var replyTo = '';
-
-/**
- * The correlator object is a mechanism used to correlate requests with
- * their aynchronous responses. It might possible be better to make use
- * of Promises to implement part of this behaviour but a mechanism 
would
- * still be needed to correlate a request with its response callback in
- * order to wrap things up in a Promise, so much of the behaviour of 
this
- * object would still be required. In addition it seemed to make sense 
to
- * make this QMF2 implementation fairly free of dependencies and using
- * Promises would require external libraries. Instead the correlator
- * implements "Promise-like" semantics, you might say a broken Promise 
:-)
- * 
- * in particular the request method behaves a *bit* like Promise.all()
- * though it is mostly fake and takes an array of functions that call
- * the add() method which is really the method used to associate 
response
- * objects by correlationID. The then method is used to register a
- * listener that will be called when all the requests that have been
- * registered have received responses.
- * TODO error/timeout handling.
- */
-var correlator = {
-_resolve: null,
-_objects: {},
-add: function(id) {
-this._objects[id] = {complete: false, list: null};
-},
-request: function() {
-this._resolve = function() {console.log("Warning: No resolver 
has been set")};
-return this;
-},
-then: function(resolver) {
-this._resolve = resolver ? resolver : this._resolve;
-},
-resolve: function() {
-var opcode = message.properties['qmf.opcode'];
-var correlationID = message.getCorrelationID();
-var resp = this._objects[correlationID];
-if (opcode === '_query_response') {
-if (resp.list) {
-Array.prototype.push.apply(resp.list, message.body); 
// This is faster than concat.
-} 

[07/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/src/core/dispatcher.c
--
diff --git a/proton-c/src/core/dispatcher.c b/proton-c/src/core/dispatcher.c
deleted file mode 100644
index 36f8cc9..000
--- a/proton-c/src/core/dispatcher.c
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- *
- */
-
-#include "dispatcher.h"
-
-#include "framing.h"
-#include "protocol.h"
-#include "engine-internal.h"
-
-#include "dispatch_actions.h"
-
-int pni_bad_frame(pn_transport_t *transport, uint8_t frame_type, uint16_t 
channel, pn_data_t *args, const pn_bytes_t *payload) {
-  pn_transport_logf(transport, "Error dispatching frame: type: %d: Unknown 
performative", frame_type);
-  return PN_ERR;
-}
-
-int pni_bad_frame_type(pn_transport_t *transport, uint8_t frame_type, uint16_t 
channel, pn_data_t *args, const pn_bytes_t *payload) {
-pn_transport_logf(transport, "Error dispatching frame: Unknown frame type: 
%d", frame_type);
-return PN_ERR;
-}
-
-// We could use a table based approach here if we needed to dynamically
-// add new performatives
-static inline int pni_dispatch_action(pn_transport_t* transport, uint64_t 
lcode, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t 
*payload)
-{
-  pn_action_t *action;
-  switch (frame_type) {
-  case AMQP_FRAME_TYPE:
-/* Regular AMQP fames */
-switch (lcode) {
-case OPEN:action = pn_do_open; break;
-case BEGIN:   action = pn_do_begin; break;
-case ATTACH:  action = pn_do_attach; break;
-case FLOW:action = pn_do_flow; break;
-case TRANSFER:action = pn_do_transfer; break;
-case DISPOSITION: action = pn_do_disposition; break;
-case DETACH:  action = pn_do_detach; break;
-case END: action = pn_do_end; break;
-case CLOSE:   action = pn_do_close; break;
-default:  action = pni_bad_frame; break;
-};
-break;
-  case SASL_FRAME_TYPE:
-/* SASL frames */
-switch (lcode) {
-case SASL_MECHANISMS: action = pn_do_mechanisms; break;
-case SASL_INIT:   action = pn_do_init; break;
-case SASL_CHALLENGE:  action = pn_do_challenge; break;
-case SASL_RESPONSE:   action = pn_do_response; break;
-case SASL_OUTCOME:action = pn_do_outcome; break;
-default:  action = pni_bad_frame; break;
-};
-break;
-  default:  action = pni_bad_frame_type; break;
-  };
-  return action(transport, frame_type, channel, args, payload);
-}
-
-static int pni_dispatch_frame(pn_transport_t * transport, pn_data_t *args, 
pn_frame_t frame)
-{
-  if (frame.size == 0) { // ignore null frames
-if (transport->trace & PN_TRACE_FRM)
-  pn_transport_logf(transport, "%u <- (EMPTY FRAME)", frame.channel);
-return 0;
-  }
-
-  ssize_t dsize = pn_data_decode(args, frame.payload, frame.size);
-  if (dsize < 0) {
-pn_string_format(transport->scratch,
- "Error decoding frame: %s %s\n", pn_code(dsize),
- pn_error_text(pn_data_error(args)));
-pn_quote(transport->scratch, frame.payload, frame.size);
-pn_transport_log(transport, pn_string_get(transport->scratch));
-return dsize;
-  }
-
-  uint8_t frame_type = frame.type;
-  uint16_t channel = frame.channel;
-  // XXX: assuming numeric -
-  // if we get a symbol we should map it to the numeric value and dispatch on 
that
-  uint64_t lcode;
-  bool scanned;
-  int e = pn_data_scan(args, "D?L.", , );
-  if (e) {
-pn_transport_log(transport, "Scan error");
-return e;
-  }
-  if (!scanned) {
-pn_transport_log(transport, "Error dispatching frame");
-return PN_ERR;
-  }
-  size_t payload_size = frame.size - dsize;
-  const char *payload_mem = payload_size ? frame.payload + dsize : NULL;
-  pn_bytes_t payload = {payload_size, payload_mem};
-
-  pn_do_trace(transport, channel, IN, args, payload_mem, payload_size);
-
-  int err = pni_dispatch_action(transport, lcode, frame_type, channel, args, 
);
-
-  pn_data_clear(args);
-
-  return err;
-}
-
-ssize_t pn_dispatcher_input(pn_transport_t 

[21/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/bindings/python/proton/__init__.py
--
diff --git a/proton-c/bindings/python/proton/__init__.py 
b/proton-c/bindings/python/proton/__init__.py
deleted file mode 100644
index d3f6922..000
--- a/proton-c/bindings/python/proton/__init__.py
+++ /dev/null
@@ -1,4298 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you 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.
-#
-
-"""
-The proton module defines a suite of APIs that implement the AMQP 1.0
-protocol.
-
-The proton APIs consist of the following classes:
-
- - L{Messenger} -- A messaging endpoint.
- - L{Message}   -- A class for creating and/or accessing AMQP message content.
- - L{Data}  -- A class for creating and/or accessing arbitrary AMQP encoded
-  data.
-
-"""
-from __future__ import absolute_import
-
-from cproton import *
-from .wrapper import Wrapper
-from proton import _compat
-
-import weakref, socket, sys, threading
-
-try:
-  import uuid
-
-  def generate_uuid():
-return uuid.uuid4()
-
-except ImportError:
-  """
-  No 'native' UUID support.  Provide a very basic UUID type that is a 
compatible subset of the uuid type provided by more modern python releases.
-  """
-  import struct
-  class uuid:
-class UUID:
-  def __init__(self, hex=None, bytes=None):
-if [hex, bytes].count(None) != 1:
-  raise TypeError("need one of hex or bytes")
-if bytes is not None:
-  self.bytes = bytes
-elif hex is not None:
-  fields=hex.split("-")
-  fields[4:5] = [fields[4][:4], fields[4][4:]]
-  self.bytes = struct.pack("!LL", *[int(x,16) for x in fields])
-
-  def __cmp__(self, other):
-if isinstance(other, uuid.UUID):
-  return cmp(self.bytes, other.bytes)
-else:
-  return -1
-
-  def __str__(self):
-return "%08x-%04x-%04x-%04x-%04x%08x" % struct.unpack("!LL", 
self.bytes)
-
-  def __repr__(self):
-return "UUID(%r)" % str(self)
-
-  def __hash__(self):
-return self.bytes.__hash__()
-
-  import os, random, time
-  rand = random.Random()
-  rand.seed((os.getpid(), time.time(), socket.gethostname()))
-  def random_uuid():
-data = [rand.randint(0, 255) for i in xrange(16)]
-
-# From RFC4122, the version bits are set to 0100
-data[6] &= 0x0F
-data[6] |= 0x40
-
-# From RFC4122, the top two bits of byte 8 get set to 01
-data[8] &= 0x3F
-data[8] |= 0x80
-return "".join(map(chr, data))
-
-  def uuid4():
-return uuid.UUID(bytes=random_uuid())
-
-  def generate_uuid():
-return uuid4()
-
-#
-# Hacks to provide Python2 <---> Python3 compatibility
-#
-try:
-  bytes()
-except NameError:
-  bytes = str
-try:
-  long()
-except NameError:
-  long = int
-try:
-  unicode()
-except NameError:
-  unicode = str
-
-
-VERSION_MAJOR = PN_VERSION_MAJOR
-VERSION_MINOR = PN_VERSION_MINOR
-VERSION_POINT = PN_VERSION_POINT
-VERSION = (VERSION_MAJOR, VERSION_MINOR, VERSION_POINT)
-API_LANGUAGE = "C"
-IMPLEMENTATION_LANGUAGE = "C"
-
-class Constant(object):
-
-  def __init__(self, name):
-self.name = name
-
-  def __repr__(self):
-return self.name
-
-class ProtonException(Exception):
-  """
-  The root of the proton exception hierarchy. All proton exception
-  classes derive from this exception.
-  """
-  pass
-
-class Timeout(ProtonException):
-  """
-  A timeout exception indicates that a blocking operation has timed
-  out.
-  """
-  pass
-
-class Interrupt(ProtonException):
-  """
-  An interrupt exception indicaes that a blocking operation was interrupted.
-  """
-  pass
-
-class MessengerException(ProtonException):
-  """
-  The root of the messenger exception hierarchy. All exceptions
-  generated by the messenger class derive from this exception.
-  """
-  pass
-
-class MessageException(ProtonException):
-  """
-  The MessageException class is the root of the message exception
-  hierarhcy. All exceptions generated by the Message class derive from
-  this exception.
-  """
-  pass
-
-EXCEPTIONS = {
-  PN_TIMEOUT: Timeout,
-  PN_INTR: Interrupt
-  }
-
-PENDING = Constant("PENDING")
-ACCEPTED = Constant("ACCEPTED")
-REJECTED = 

[19/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/bindings/python/setup.py.in
--
diff --git a/proton-c/bindings/python/setup.py.in 
b/proton-c/bindings/python/setup.py.in
deleted file mode 100755
index 57f4368..000
--- a/proton-c/bindings/python/setup.py.in
+++ /dev/null
@@ -1,323 +0,0 @@
-#!/usr/bin/env python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you 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.
-
-"""
-python-qpid-proton setup script
-
-DISCLAIMER: This script took lots of inspirations from PyZMQ, which is licensed
-under the 'MODIFIED BSD LICENSE'.
-
-Although inspired by the work in PyZMQ, this script and the modules it depends
-on were largely simplified to meet the requirements of the library.
-
-The behavior of this script is to build the registered `_cproton` extension
-using the installed Qpid Proton C library and header files. If the library and
-headers are not installed, or the installed version does not match the version
-of these python bindings, then the script will attempt to build the extension
-using the Proton C sources included in the python source distribution package.
-
-While the above removes the need of *always* having Qpid Proton C development
-files installed, it does not solve the need of having `swig` and the libraries
-qpid-proton requires installed to make this setup work.
-
-From the Python side, this scripts overrides 1 command - build_ext - and it 
adds a
-new one. The latter - Configure - is called from the former to setup/discover 
what's
-in the system. The rest of the comands and steps are done normally without any 
kind
-of monkey patching.
-"""
-
-import glob
-import os
-import subprocess
-import sys
-
-import distutils.spawn as ds_spawn
-import distutils.sysconfig as ds_sys
-from distutils.ccompiler import new_compiler, get_default_compiler
-from distutils.core import setup, Extension
-from distutils.command.build import build
-from distutils.command.build_ext import build_ext
-from distutils.command.sdist import sdist
-from distutils import errors
-
-from setuputils import log
-from setuputils import misc
-
-
-_PROTON_VERSION=(@PN_VERSION_MAJOR@,
- @PN_VERSION_MINOR@,
- @PN_VERSION_POINT@)
-_PROTON_VERSION_STR = "%d.%d.%d" % _PROTON_VERSION
-
-
-class CheckSDist(sdist):
-
-def run(self):
-self.distribution.run_command('configure')
-
-# Append the source that was removed during
-# the configuration step.
-_cproton = self.distribution.ext_modules[-1]
-_cproton.sources.append('cproton.i')
-
-try:
-sdist.run(self)
-finally:
-for src in ['cproton.py', 'cproton_wrap.c']:
-if os.path.exists(src):
-os.remove(src)
-
-
-class Configure(build_ext):
-description = "Discover Qpid Proton version"
-
-@property
-def compiler_type(self):
-compiler = self.compiler
-if compiler is None:
-return get_default_compiler()
-elif isinstance(compiler, str):
-return compiler
-else:
-return compiler.compiler_type
-
-def prepare_swig_wrap(self):
-"""Run swig against the sources.  This will cause swig to compile the
-cproton.i file into a .c file called cproton_wrap.c, and create
-cproton.py.
-"""
-ext = self.distribution.ext_modules[-1]
-
-if 'SWIG' in os.environ:
-self.swig = os.environ['SWIG']
-
-try:
-# This will actually call swig to generate the files
-# and list the sources.
-self.swig_sources(ext.sources, ext)
-except (errors.DistutilsExecError, errors.DistutilsPlatformError) as e:
-if not (os.path.exists('cproton_wrap.c') or
-os.path.exists('cproton.py')):
-raise e
-
-# now remove the cproton.i file from the source list so we don't run
-# swig again.
-ext.sources = ext.sources[1:]
-ext.swig_opts = []
-
-def use_bundled_proton(self):
-"""The proper version of libqpid-proton is not installed on the system,
-so use the included proton-c sources to 

[32/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/bindings/cpp/src/session.cpp
--
diff --git a/proton-c/bindings/cpp/src/session.cpp 
b/proton-c/bindings/cpp/src/session.cpp
deleted file mode 100644
index de152d6..000
--- a/proton-c/bindings/cpp/src/session.cpp
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- *
- */
-#include "proton/session.hpp"
-
-#include "proton/connection.hpp"
-#include "proton/receiver_options.hpp"
-#include "proton/sender_options.hpp"
-#include "proton/session_options.hpp"
-
-#include "contexts.hpp"
-#include "proton_bits.hpp"
-
-#include 
-#include 
-
-#include 
-
-namespace proton {
-
-void session::open() {
-pn_session_open(pn_object());
-}
-
-void session::open(const session_options ) {
-opts.apply(*this);
-pn_session_open(pn_object());
-}
-
-void session::close()
-{
-pn_session_close(pn_object());
-}
-
-container& session::container() const {
-return connection().container();
-}
-
-connection session::connection() const {
-return make_wrapper(pn_session_connection(pn_object()));
-}
-
-namespace {
-std::string next_link_name(const connection& c) {
-io::link_namer* ln = connection_context::get(c).link_gen;
-
-return ln ? ln->link_name() : uuid::random().str();
-}
-}
-
-sender session::open_sender(const std::string ) {
-return open_sender(addr, sender_options());
-}
-
-sender session::open_sender(const std::string , const sender_options ) 
{
-pn_link_t *lnk = pn_sender(pn_object(), 
next_link_name(connection()).c_str());
-pn_terminus_set_address(pn_link_target(lnk), addr.c_str());
-sender snd(make_wrapper(lnk));
-snd.open(so);
-return snd;
-}
-
-receiver session::open_receiver(const std::string ) {
-return open_receiver(addr, receiver_options());
-}
-
-receiver session::open_receiver(const std::string , const 
receiver_options )
-{
-pn_link_t *lnk = pn_receiver(pn_object(), 
next_link_name(connection()).c_str());
-pn_terminus_set_address(pn_link_source(lnk), addr.c_str());
-receiver rcv(make_wrapper(lnk));
-rcv.open(ro);
-return rcv;
-}
-
-error_condition session::error() const {
-return make_wrapper(pn_session_remote_condition(pn_object()));
-}
-
-size_t session::incoming_bytes() const {
-return pn_session_incoming_bytes(pn_object());
-}
-
-size_t session::outgoing_bytes() const {
-return pn_session_outgoing_bytes(pn_object());
-}
-
-sender_range session::senders() const {
-pn_link_t *lnk = pn_link_head(pn_session_connection(pn_object()), 0);
-while (lnk) {
-if (pn_link_is_sender(lnk) && pn_link_session(lnk) == pn_object())
-break;
-lnk = pn_link_next(lnk, 0);
-}
-return sender_range(sender_iterator(make_wrapper(lnk), 
pn_object()));
-}
-
-receiver_range session::receivers() const {
-pn_link_t *lnk = pn_link_head(pn_session_connection(pn_object()), 0);
-while (lnk) {
-if (pn_link_is_receiver(lnk) && pn_link_session(lnk) == pn_object())
-break;
-lnk = pn_link_next(lnk, 0);
-}
-return receiver_range(receiver_iterator(make_wrapper(lnk), 
pn_object()));
-}
-
-session_iterator session_iterator::operator++() {
-obj_ = pn_session_next(unwrap(obj_), 0);
-return *this;
-}
-
-} // namespace proton

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/bindings/cpp/src/session_options.cpp
--
diff --git a/proton-c/bindings/cpp/src/session_options.cpp 
b/proton-c/bindings/cpp/src/session_options.cpp
deleted file mode 100644
index 2147fd4..000
--- a/proton-c/bindings/cpp/src/session_options.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may 

[10/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/include/proton/selectable.h
--
diff --git a/proton-c/include/proton/selectable.h 
b/proton-c/include/proton/selectable.h
deleted file mode 100644
index 8c0a4db..000
--- a/proton-c/include/proton/selectable.h
+++ /dev/null
@@ -1,271 +0,0 @@
-#ifndef PROTON_SELECTABLE_H
-#define PROTON_SELECTABLE_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- *
- */
-
-#include 
-#include 
-#include 
-#include 
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @cond INTERNAL
- */
-
-/**
- * An iterator for selectables.
- */
-typedef pn_iterator_t pn_selectables_t;
-
-/**
- * A ::pn_socket_t provides an abstract handle to an IO stream.  The
- * pipe version is uni-directional.  The network socket version is
- * bi-directional.  Both are non-blocking.
- *
- * pn_socket_t handles from pn_pipe() may only be used with
- * pn_read(), pn_write(), pn_close() and pn_selector_select().
- *
- * pn_socket_t handles from pn_listen(), pn_accept() and
- * pn_connect() must perform further IO using Proton functions.
- * Mixing Proton io.h functions with native IO functions on the same
- * handles will result in undefined behavior.
- *
- * pn_socket_t handles may only be used with a single pn_io_t during
- * their lifetime.
- */
-#if defined(_WIN32) && ! defined(__CYGWIN__)
-#ifdef _WIN64
-typedef unsigned __int64 pn_socket_t;
-#else
-typedef unsigned int pn_socket_t;
-#endif
-#define PN_INVALID_SOCKET (pn_socket_t)(~0)
-#else
-typedef int pn_socket_t;
-#define PN_INVALID_SOCKET (-1)
-#endif
-
-/**
- * A selectable object provides an interface that can be used to
- * incorporate proton's I/O into third party event loops.
- *
- * Every selectable is associated with exactly one file descriptor.
- * Selectables may be interested in three kinds of events, read
- * events, write events, and timer events. 
- *
- * When a read, write, or timer event occurs, the selectable must be
- * notified by calling ::pn_selectable_readable(),
- * ::pn_selectable_writable(), and ::pn_selectable_expired() as
- * appropriate.
- *
- * Once a selectable reaches a terminal state (see
- * ::pn_selectable_is_terminal()), it will never be interested in
- * events of any kind. When this occurs it should be removed from the
- * external event loop and discarded using ::pn_selectable_free().
- */
-typedef struct pn_selectable_t pn_selectable_t;
-
-/**
- * Construct a new selectables iterator.
- *
- * @return a pointer to a new selectables iterator
- */
-PNX_EXTERN pn_selectables_t *pn_selectables(void);
-
-/**
- * Get the next selectable from an iterator.
- *
- * @param[in] selectables a selectable iterator
- * @return the next selectable from the iterator
- */
-PNX_EXTERN pn_selectable_t *pn_selectables_next(pn_selectables_t *selectables);
-
-/**
- * Free a selectables iterator.
- *
- * @param[in] selectables a selectables iterator (or NULL)
- */
-PNX_EXTERN void pn_selectables_free(pn_selectables_t *selectables);
-
-PNX_EXTERN pn_selectable_t *pn_selectable(void);
-
-PNX_EXTERN void pn_selectable_on_readable(pn_selectable_t *sel, void 
(*readable)(pn_selectable_t *));
-PNX_EXTERN void pn_selectable_on_writable(pn_selectable_t *sel, void 
(*writable)(pn_selectable_t *));
-PNX_EXTERN void pn_selectable_on_expired(pn_selectable_t *sel, void 
(*expired)(pn_selectable_t *));
-PNX_EXTERN void pn_selectable_on_error(pn_selectable_t *sel, void 
(*error)(pn_selectable_t *));
-PNX_EXTERN void pn_selectable_on_release(pn_selectable_t *sel, void 
(*release)(pn_selectable_t *));
-PNX_EXTERN void pn_selectable_on_finalize(pn_selectable_t *sel, void 
(*finalize)(pn_selectable_t *));
-
-PNX_EXTERN pn_record_t *pn_selectable_attachments(pn_selectable_t *sel);
-
-/**
- * Get the file descriptor associated with a selectable.
- *
- * @param[in] selectable a selectable object
- * @return the file descriptor associated with the selectable
- */
-PNX_EXTERN pn_socket_t pn_selectable_get_fd(pn_selectable_t *selectable);
-
-/**
- * Set the file descriptor associated with a selectable.
- *
- * @param[in] selectable a selectable object
- * @param[in] fd the file descriptor
- 

[16/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/bindings/ruby/lib/messenger/messenger.rb
--
diff --git a/proton-c/bindings/ruby/lib/messenger/messenger.rb 
b/proton-c/bindings/ruby/lib/messenger/messenger.rb
deleted file mode 100644
index 70a01de..000
--- a/proton-c/bindings/ruby/lib/messenger/messenger.rb
+++ /dev/null
@@ -1,702 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you 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.
-#
-
-module Qpid::Proton::Messenger
-
-  # The +Messenger+ class defines a high level interface for
-  # sending and receiving Messages. Every Messenger contains
-  # a single logical queue of incoming messages and a single
-  # logical queue of outgoing messages. These messages in these
-  # queues may be destined for, or originate from, a variety of
-  # addresses.
-  #
-  # The messenger interface is single-threaded.  All methods
-  # except one ( #interrupt ) are intended to be used from within
-  # the messenger thread.
-  #
-  # === Sending & Receiving Messages
-  #
-  # The Messenger class works in conjuction with the Message class. The
-  # Message class is a mutable holder of message content.
-  #
-  # The put method copies its Message to the outgoing queue, and may
-  # send queued messages if it can do so without blocking.  The send
-  # method blocks until it has sent the requested number of messages,
-  # or until a timeout interrupts the attempt.
-  #
-  # Similarly, the recv method receives messages into the incoming
-  # queue, and may block as it attempts to receive the requested number
-  # of messages,  or until timeout is reached. It may receive fewer
-  # than the requested number.  The get method pops the
-  # eldest Message off the incoming queue and copies it into the Message
-  # object that you supply.  It will not block.
-  #
-  # The blocking attribute allows you to turn off blocking behavior entirely,
-  # in which case send and recv will do whatever they can without
-  # blocking, and then return.  You can then look at the number
-  # of incoming and outgoing messages to see how much outstanding work
-  # still remains.
-  #
-  class Messenger
-
-include Qpid::Proton::Util::ErrorHandler
-
-can_raise_error [:send, :receive, :password=, :start, :stop,
- :perform_put, :perform_get, :interrupt,
- :route, :rewrite, :accept, :reject,
- :incoming_window=, :outgoing_window=]
-
-# Creates a new +Messenger+.
-#
-# The +name+ parameter is optional. If one is not provided then
-# a unique name is generated.
-#
-#  Options
-#
-# * name - the name (def. nil)
-#
-def initialize(name = nil)
-  @impl = Cproton.pn_messenger(name)
-  @selectables = {}
-  ObjectSpace.define_finalizer(self, self.class.finalize!(@impl))
-end
-
-def self.finalize!(impl) # :nodoc:
-  proc {
-Cproton.pn_messenger_free(impl)
-  }
-end
-
-# Returns the name.
-#
-def name
-  Cproton.pn_messenger_name(@impl)
-end
-
-# This property contains the password for the Messenger.private_key
-# file, or +nil+ if the file is not encrypted.
-#
-#  Arguments
-#
-# * password - the password
-#
-def password=(password)
-  Cproton.pn_messenger_set_password(@impl, password)
-end
-
-# Returns the password property for the Messenger.private_key file.
-#
-def password
-  Cproton.pn_messenger_get_password(@impl)
-end
-
-# Sets the timeout period, in milliseconds.
-#
-# A negative timeout period implies an infinite timeout.
-#
-#  Options
-#
-# * timeout - the timeout period
-#
-def timeout=(timeout)
-  raise TypeError.new("invalid timeout: #{timeout}") if timeout.nil?
-  Cproton.pn_messenger_set_timeout(@impl, timeout)
-end
-
-# Returns the timeout period
-#
-def timeout
-  Cproton.pn_messenger_get_timeout(@impl)
-end
-
-# Returns true if blocking mode is enabled.
-#
-# Enable or disable blocking behavior during message sending
-# and receiving.  This affects every blocking call, with the
-# 

[01/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
Repository: qpid-proton-j
Updated Branches:
  refs/heads/master 79d06f070 -> 2afe2ec09


http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/src/messenger/store.c
--
diff --git a/proton-c/src/messenger/store.c b/proton-c/src/messenger/store.c
deleted file mode 100644
index 44f24f1..000
--- a/proton-c/src/messenger/store.c
+++ /dev/null
@@ -1,442 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- *
- */
-
-#include 
-#include 
-#include 
-#include 
-#ifndef __cplusplus
-#include 
-#endif
-#include 
-#include 
-#include "core/util.h"
-#include "store.h"
-
-typedef struct pni_stream_t pni_stream_t;
-
-struct pni_store_t {
-  pni_stream_t *streams;
-  pni_entry_t *store_head;
-  pni_entry_t *store_tail;
-  pn_hash_t *tracked;
-  size_t size;
-  int window;
-  pn_sequence_t lwm;
-  pn_sequence_t hwm;
-};
-
-struct pni_stream_t {
-  pni_store_t *store;
-  pn_string_t *address;
-  pni_entry_t *stream_head;
-  pni_entry_t *stream_tail;
-  pni_stream_t *next;
-};
-
-struct pni_entry_t {
-  pni_stream_t *stream;
-  pni_entry_t *stream_next;
-  pni_entry_t *stream_prev;
-  pni_entry_t *store_next;
-  pni_entry_t *store_prev;
-  pn_buffer_t *bytes;
-  pn_delivery_t *delivery;
-  void *context;
-  pn_status_t status;
-  pn_sequence_t id;
-  bool free;
-};
-
-void pni_entry_finalize(void *object)
-{
-  pni_entry_t *entry = (pni_entry_t *) object;
-  assert(entry->free);
-  pn_delivery_t *d = entry->delivery;
-  if (d) {
-pn_delivery_settle(d);
-pni_entry_set_delivery(entry, NULL);
-  }
-}
-
-pni_store_t *pni_store()
-{
-  pni_store_t *store = (pni_store_t *) malloc(sizeof(pni_store_t));
-  if (!store) return NULL;
-
-  store->size = 0;
-  store->streams = NULL;
-  store->store_head = NULL;
-  store->store_tail = NULL;
-  store->window = 0;
-  store->lwm = 0;
-  store->hwm = 0;
-  store->tracked = pn_hash(PN_OBJECT, 0, 0.75);
-
-  return store;
-}
-
-size_t pni_store_size(pni_store_t *store)
-{
-  assert(store);
-  return store->size;
-}
-
-pni_stream_t *pni_stream(pni_store_t *store, const char *address, bool create)
-{
-  assert(store);
-  assert(address);
-
-  pni_stream_t *prev = NULL;
-  pni_stream_t *stream = store->streams;
-  while (stream) {
-if (!strcmp(pn_string_get(stream->address), address)) {
-  return stream;
-}
-prev = stream;
-stream = stream->next;
-  }
-
-  if (create) {
-stream = (pni_stream_t *) malloc(sizeof(pni_stream_t));
-if (stream != NULL) {
-  stream->store = store;
-  stream->address = pn_string(address);
-  stream->stream_head = NULL;
-  stream->stream_tail = NULL;
-  stream->next = NULL;
-
-  if (prev) {
-prev->next = stream;
-  } else {
-store->streams = stream;
-  }
-}
-  }
-
-  return stream;
-}
-
-pni_stream_t *pni_stream_head(pni_store_t *store)
-{
-  assert(store);
-  return store->streams;
-}
-
-pni_stream_t *pni_stream_next(pni_stream_t *stream)
-{
-  assert(stream);
-  return stream->next;
-}
-
-void pni_entry_free(pni_entry_t *entry)
-{
-  if (!entry) return;
-  pni_stream_t *stream = entry->stream;
-  pni_store_t *store = stream->store;
-  LL_REMOVE(stream, stream, entry);
-  LL_REMOVE(store, store, entry);
-  entry->free = true;
-
-  pn_buffer_free(entry->bytes);
-  entry->bytes = NULL;
-  pn_decref(entry);
-  store->size--;
-}
-
-void pni_stream_free(pni_stream_t *stream)
-{
-  if (!stream) return;
-  pni_entry_t *entry;
-  while ((entry = LL_HEAD(stream, stream))) {
-pni_entry_free(entry);
-  }
-  pn_free(stream->address);
-  stream->address = NULL;
-  free(stream);
-}
-
-void pni_store_free(pni_store_t *store)
-{
-  if (!store) return;
-  pn_free(store->tracked);
-  pni_stream_t *stream = store->streams;
-  while (stream) {
-pni_stream_t *next = stream->next;
-pni_stream_free(stream);
-stream = next;
-  }
-  free(store);
-}
-
-pni_stream_t *pni_stream_put(pni_store_t *store, const char *address)
-{
-  assert(store); assert(address);
-  return pni_stream(store, address, true);
-}
-
-pni_stream_t *pni_stream_get(pni_store_t *store, const char *address)
-{
-  assert(store); assert(address);
-  return 

[14/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/bindings/ruby/spec/qpid/proton/messenger_spec.rb
--
diff --git a/proton-c/bindings/ruby/spec/qpid/proton/messenger_spec.rb 
b/proton-c/bindings/ruby/spec/qpid/proton/messenger_spec.rb
deleted file mode 100644
index 8e50331..000
--- a/proton-c/bindings/ruby/spec/qpid/proton/messenger_spec.rb
+++ /dev/null
@@ -1,407 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you 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.
-#
-
-require "spec_helper"
-
-module Qpid
-
-  module Proton
-
-describe "A messenger" do
-
-  before (:each) do
-@messenger = Qpid::Proton::Messenger::Messenger.new
-  end
-
-  after (:each) do
-begin
-  @messenger.stop
-rescue ProtonError => error
-  # ignore this error
-end
-  end
-
-  it "will generate a name if one is not provided" do
-expect(@messenger.name).to_not be_nil
-  end
-
-  it "will accept an assigned name" do
-name = random_string(16)
-msgr = Qpid::Proton::Messenger::Messenger.new(name)
-expect(msgr.name).to eq(name)
-  end
-
-  it "raises an error on a nil timeout" do
-expect {
-  @messenger.timeout = nil
-}.to raise_error(TypeError)
-  end
-
-  it "can have a negative timeout" do
-timeout = (0 - rand(65535))
-@messenger.timeout = timeout
-expect(@messenger.timeout).to eq(timeout)
-  end
-
-  it "has a timeout" do
-timeout = rand(65535)
-@messenger.timeout = timeout
-expect(@messenger.timeout).to eq(timeout)
-  end
-
-  it "has an error number" do
-expect(@messenger.error?).to eq(false)
-expect(@messenger.errno).to eq(0)
-# force an error
-expect {
-  @messenger.subscribe("amqp://~#{random_string}")
-}.to raise_error(ProtonError)
-expect(@messenger.error?).to eq(true)
-expect(@messenger.errno).to_not eq(0)
-  end
-
-  it "has an error message" do
-expect(@messenger.error?).to eq(false)
-expect(@messenger.error).to be_nil
-# force an error
-expect {
-  @messenger.subscribe("amqp://~#{random_string}")
-}.to raise_error(ProtonError)
-expect(@messenger.error?).to eq(true)
-expect(@messenger.errno).to_not be_nil
-  end
-
-  it "can be started" do
-expect {
-  @messenger.start
-}.to_not raise_error
-  end
-
-  it "can be stopped" do
-expect {
-  @messenger.stop
-}.to_not raise_error
-  end
-
-  it "raises an error when subscribing to a nil address" do
-expect {
-  @messenger.subscribe(nil)
-}.to raise_error(TypeError)
-  end
-
-  it "raises an error when subscribing to an invalid address" do
-expect {
-  @messenger.subscribe("amqp://~#{random_string}")
-}.to raise_error(ProtonError)
-expect(@messenger.error?).to eq(true)
-expect(@messenger.errno).to_not eq(nil)
-  end
-
-  it "can have a nil certificate" do
-expect {
-  @messenger.certificate = nil
-  expect(@messenger.certificate).to be_nil
-}.to_not raise_error
-  end
-
-  it "can have a certificate" do
-cert = random_string(128)
-@messenger.certificate = cert
-expect(@messenger.certificate).to eq(cert)
-  end
-
-  it "can have a nil private key" do
-expect {
-  @messenger.private_key = nil
-  expect(@messenger.private_key).to be_nil
-}.to_not raise_error
-  end
-
-  it "can have a private key" do
-key = random_string(128)
-@messenger.private_key = key
-expect(@messenger.private_key).to eq(key)
-  end
-
-  it "can have a nil trusted certificates" do
-expect {
-  @messenger.trusted_certificates = nil
-  expect(@messenger.trusted_certificates).to be_nil
-}.to_not raise_error
-  end
-
-  it "has a list of trusted certificates" do
-certs = random_string(128)
-@messenger.trusted_certificates = certs
-

[08/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/src/core/codec.c
--
diff --git a/proton-c/src/core/codec.c b/proton-c/src/core/codec.c
deleted file mode 100644
index 67769ad..000
--- a/proton-c/src/core/codec.c
+++ /dev/null
@@ -1,2141 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- *
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include "encodings.h"
-#define DEFINE_FIELDS
-#include "protocol.h"
-#include "platform/platform_fmt.h"
-#include "util.h"
-#include "decoder.h"
-#include "encoder.h"
-#include "data.h"
-#include "log_private.h"
-
-const char *pn_type_name(pn_type_t type)
-{
-  switch (type)
-  {
-  case PN_NULL: return "PN_NULL";
-  case PN_BOOL: return "PN_BOOL";
-  case PN_UBYTE: return "PN_UBYTE";
-  case PN_BYTE: return "PN_BYTE";
-  case PN_USHORT: return "PN_USHORT";
-  case PN_SHORT: return "PN_SHORT";
-  case PN_UINT: return "PN_UINT";
-  case PN_INT: return "PN_INT";
-  case PN_CHAR: return "PN_CHAR";
-  case PN_ULONG: return "PN_ULONG";
-  case PN_LONG: return "PN_LONG";
-  case PN_TIMESTAMP: return "PN_TIMESTAMP";
-  case PN_FLOAT: return "PN_FLOAT";
-  case PN_DOUBLE: return "PN_DOUBLE";
-  case PN_DECIMAL32: return "PN_DECIMAL32";
-  case PN_DECIMAL64: return "PN_DECIMAL64";
-  case PN_DECIMAL128: return "PN_DECIMAL128";
-  case PN_UUID: return "PN_UUID";
-  case PN_BINARY: return "PN_BINARY";
-  case PN_STRING: return "PN_STRING";
-  case PN_SYMBOL: return "PN_SYMBOL";
-  case PN_DESCRIBED: return "PN_DESCRIBED";
-  case PN_ARRAY: return "PN_ARRAY";
-  case PN_LIST: return "PN_LIST";
-  case PN_MAP: return "PN_MAP";
-  default: break;
-  }
-
-  return "";
-}
-
-static inline void pni_atom_init(pn_atom_t *atom, pn_type_t type)
-{
-  memset(atom, 0, sizeof(pn_atom_t));
-  atom->type = type;
-}
-
-// data
-
-static void pn_data_finalize(void *object)
-{
-  pn_data_t *data = (pn_data_t *) object;
-  free(data->nodes);
-  pn_buffer_free(data->buf);
-  pn_free(data->str);
-  pn_error_free(data->error);
-  pn_free(data->decoder);
-  pn_free(data->encoder);
-}
-
-static const pn_fields_t *pni_node_fields(pn_data_t *data, pni_node_t *node)
-{
-  if (!node) return NULL;
-  if (node->atom.type != PN_DESCRIBED) return NULL;
-
-  pni_node_t *descriptor = pn_data_node(data, node->down);
-
-  if (!descriptor || descriptor->atom.type != PN_ULONG) {
-return NULL;
-  }
-
-  if (descriptor->atom.u.as_ulong >= FIELD_MIN && descriptor->atom.u.as_ulong 
<= FIELD_MAX) {
-const pn_fields_t *f = [descriptor->atom.u.as_ulong-FIELD_MIN];
-return (f->name_index!=0) ? f : NULL;
-  } else {
-return NULL;
-  }
-}
-
-static int pni_node_index(pn_data_t *data, pni_node_t *node)
-{
-  int count = 0;
-  while (node) {
-node = pn_data_node(data, node->prev);
-count++;
-  }
-  return count - 1;
-}
-
-int pni_inspect_atom(pn_atom_t *atom, pn_string_t *str)
-{
-  switch (atom->type) {
-  case PN_NULL:
-return pn_string_addf(str, "null");
-  case PN_BOOL:
-return pn_string_addf(str, atom->u.as_bool ? "true" : "false");
-  case PN_UBYTE:
-return pn_string_addf(str, "%" PRIu8, atom->u.as_ubyte);
-  case PN_BYTE:
-return pn_string_addf(str, "%" PRIi8, atom->u.as_byte);
-  case PN_USHORT:
-return pn_string_addf(str, "%" PRIu16, atom->u.as_ushort);
-  case PN_SHORT:
-return pn_string_addf(str, "%" PRIi16, atom->u.as_short);
-  case PN_UINT:
-return pn_string_addf(str, "%" PRIu32, atom->u.as_uint);
-  case PN_INT:
-return pn_string_addf(str, "%" PRIi32, atom->u.as_int);
-  case PN_CHAR:
-return pn_string_addf(str, "%c",  atom->u.as_char);
-  case PN_ULONG:
-return pn_string_addf(str, "%" PRIu64, atom->u.as_ulong);
-  case PN_LONG:
-return pn_string_addf(str, "%" PRIi64, atom->u.as_long);
-  case PN_TIMESTAMP:
-return pn_string_addf(str, "%" PRIi64, atom->u.as_timestamp);
-  case PN_FLOAT:
-return pn_string_addf(str, "%g", atom->u.as_float);
-  case PN_DOUBLE:
-return pn_string_addf(str, "%g", atom->u.as_double);
-  case PN_DECIMAL32:
-return pn_string_addf(str, "D32(%" PRIu32 ")", atom->u.as_decimal32);
-  case 

[53/55] qpid-proton-j git commit: PROTON-1362: remove previously-deprecated Messenger

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2afe2ec0/proton-j/src/test/java/org/apache/qpid/proton/reactor/impl/AddressTest.java
--
diff --git 
a/proton-j/src/test/java/org/apache/qpid/proton/reactor/impl/AddressTest.java 
b/proton-j/src/test/java/org/apache/qpid/proton/reactor/impl/AddressTest.java
new file mode 100644
index 000..6b2da05
--- /dev/null
+++ 
b/proton-j/src/test/java/org/apache/qpid/proton/reactor/impl/AddressTest.java
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.qpid.proton.reactor.impl;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+
+public class AddressTest {
+
+@SuppressWarnings("deprecation")
+private void testParse(String url, String scheme, String user, String 
pass, String host, String port, String name)
+{
+Address address = new Address(url);
+assertEquals(scheme, address.getScheme());
+assertEquals(user, address.getUser());
+assertEquals(pass, address.getPass());
+assertEquals(host, address.getHost());
+assertEquals(port, address.getPort());
+assertEquals(url, address.toString());
+}
+
+@Test
+public void addressTests()
+{
+testParse("host", null, null, null, "host", null, null);
+testParse("host:423", null, null, null, "host", "423", null);
+testParse("user@host", null, "user", null, "host", null, null);
+testParse("user:1243^&^:pw@host:423", null, "user", "1243^&^:pw", 
"host", "423", null);
+testParse("user:1243^&^:pw@host:423/Foo.bar:90087", null, "user", 
"1243^&^:pw", "host", "423", "Foo.bar:90087");
+testParse("user:1243^&^:pw@host:423/Foo.bar:90087@somewhere", null, 
"user", "1243^&^:pw", "host", "423", "Foo.bar:90087@somewhere");
+testParse("[::1]", null, null, null, "::1", null, null);
+testParse("[::1]:amqp", null, null, null, "::1", "amqp", null);
+testParse("user@[::1]", null, "user", null, "::1", null, null);
+testParse("user@[::1]:amqp", null, "user", null, "::1", "amqp", null);
+testParse("user:1243^&^:pw@[::1]:amqp", null, "user", "1243^&^:pw", 
"::1", "amqp", null);
+testParse("user:1243^&^:pw@[::1]:amqp/Foo.bar:90087", null, "user", 
"1243^&^:pw", "::1", "amqp", "Foo.bar:90087");
+testParse("user:1243^&^:pw@[::1:amqp/Foo.bar:90087", null, "user", 
"1243^&^:pw", "[", ":1:amqp", "Foo.bar:90087");
+testParse("user:1243^&^:pw@::1]:amqp/Foo.bar:90087", null, "user", 
"1243^&^:pw", "", ":1]:amqp", "Foo.bar:90087");
+testParse("amqp://user@[::1]", "amqp", "user", null, "::1", null, 
null);
+testParse("amqp://user@[::1]:amqp", "amqp", "user", null, "::1", 
"amqp", null);
+testParse("amqp://user@[1234:52:0:1260:f2de:f1ff:fe59:8f87]:amqp", 
"amqp", "user", null, "1234:52:0:1260:f2de:f1ff:fe59:8f87", "amqp", null);
+testParse("amqp://user:1243^&^:pw@[::1]:amqp", "amqp", "user", 
"1243^&^:pw", "::1", "amqp", null);
+testParse("amqp://user:1243^&^:pw@[::1]:amqp/Foo.bar:90087", "amqp", 
"user", "1243^&^:pw", "::1", "amqp", "Foo.bar:90087");
+testParse("amqp://host", "amqp", null, null, "host", null, null);
+testParse("amqp://user@host", "amqp", "user", null, "host", null, 
null);
+testParse("amqp://user@host/path:%", "amqp", "user", null, "host", 
null, "path:%");
+testParse("amqp://user@host:5674/path:%", "amqp", "user", null, 
"host", "5674", "path:%");
+testParse("amqp://user@host/path:%", "amqp", "user", null, "host", 
null, "path:%");
+testParse("amqp://bigbird@host/queue@host", "amqp", "bigbird", null, 
"host", null, "queue@host");
+testParse("amqp://host/queue@host", "amqp", null, null, "host", null, 
"queue@host");
+testParse("amqp://host:9765/queue@host", "amqp", null, null, "host", 
"9765", "queue@host");
+}
+}

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2afe2ec0/tests/java/pythonTests.ignore
--
diff --git a/tests/java/pythonTests.ignore b/tests/java/pythonTests.ignore
index 

[46/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/examples/cpp/helloworld_direct.cpp
--
diff --git a/examples/cpp/helloworld_direct.cpp 
b/examples/cpp/helloworld_direct.cpp
deleted file mode 100644
index b3a1af8..000
--- a/examples/cpp/helloworld_direct.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- *
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include 
-
-#include "fake_cpp11.hpp"
-
-class hello_world_direct : public proton::messaging_handler {
-  private:
-std::string url;
-proton::listener listener;
-
-  public:
-hello_world_direct(const std::string& u) : url(u) {}
-
-void on_container_start(proton::container ) OVERRIDE {
-listener = c.listen(url);
-c.open_sender(url);
-}
-
-void on_sendable(proton::sender ) OVERRIDE {
-proton::message m("Hello World!");
-s.send(m);
-s.close();
-}
-
-void on_message(proton::delivery &, proton::message ) OVERRIDE {
-std::cout << m.body() << std::endl;
-}
-
-void on_tracker_accept(proton::tracker ) OVERRIDE {
-t.connection().close();
-}
-
-void on_connection_close(proton::connection&) OVERRIDE {
-listener.stop();
-}
-};
-
-int main(int argc, char **argv) {
-try {
-// Pick an "unusual" port since we are going to be talking to
-// ourselves, not a broker.
-std::string url = argc > 1 ? argv[1] : "127.0.0.1:/examples";
-
-hello_world_direct hwd(url);
-proton::default_container(hwd).run();
-
-return 0;
-} catch (const std::exception& e) {
-std::cerr << e.what() << std::endl;
-}
-
-return 1;
-}

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/examples/cpp/mt/broker.cpp
--
diff --git a/examples/cpp/mt/broker.cpp b/examples/cpp/mt/broker.cpp
deleted file mode 100644
index 83b7005..000
--- a/examples/cpp/mt/broker.cpp
+++ /dev/null
@@ -1,318 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- */
-
-#include "../options.hpp"
-#include "mt_container.hpp"
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include "../fake_cpp11.hpp"
-
-// Thread safe queue.
-// Stores messages, notifies subscribed connections when there is data.
-class queue {
-  public:
-queue(const std::string& name) : name_(name) {}
-
-std::string name() const { return name_; }
-
-// Push a message onto the queue.
-// If the queue was previously empty, notify subscribers it has messages.
-// Called from receiver's connection.
-void push(const proton::message ) {
-std::lock_guard g(lock_);
-messages_.push_back(m);
-if (messages_.size() == 1) { // Non-empty, notify subscribers
-for (auto cb : callbacks_)
-cb(this);
-callbacks_.clear();
-}
-}
-
-// If the queue is not empty, pop a message into m and return true.
-// Otherwise save callback to be called when there are messages and return 
false.
-// Called from 

[17/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/bindings/ruby/lib/core/transport.rb
--
diff --git a/proton-c/bindings/ruby/lib/core/transport.rb 
b/proton-c/bindings/ruby/lib/core/transport.rb
deleted file mode 100644
index 9ba5dc8..000
--- a/proton-c/bindings/ruby/lib/core/transport.rb
+++ /dev/null
@@ -1,411 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you 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.
-#++
-
-module Qpid::Proton
-
-  # A transport is used by a connection to interface with the network.
-  #
-  # A transport is associated with, at most, one Connection.
-  #
-  # == Client And Server Mode
-  #
-  # Initially, a transport is configured to be a client tranpsort. It can be
-  # configured to act as a server when it is created.
-  #
-  # A client transport initiates outgoing connections.
-  #
-  # A client transport must be configured with the protocol layers to use and
-  # cannot configure itself automatically.
-  #
-  # A server transport accepts incoming connections. It can automatically
-  # configure itself to include the various protocol layers depending on the
-  # incoming protocol headers.
-  #
-  # == Tracing Data
-  #
-  # Data can be traced into and out of the transport programmatically by 
setting
-  # the #trace level to one of the defined trace values (TRACE_RAW, TRACE_FRM 
or
-  # TRACE_DRV). Tracing can also be turned off programmatically by setting the
-  # #trace level to TRACE_OFF.
-  #
-  # @example
-  #
-  #   # turns on frame tracing
-  #   @transport.trace = Qpid::Proton::Transport::TRACE_FRM
-  #
-  #   # ... do something where the frames are of interest, such as debugging
-  #
-  #   # turn tracing off again
-  #   @transport.trace = Qpid::Proton::Transport::TRACE_NONE
-  #
-  # Tracing can also be enabled from the command line by defining the similarly
-  # named environment variable before starting a Proton application:
-  #
-  # @example
-  #
-  #   # enable tracing from the command line
-  #   PN_TRACE_FRM=1 ruby my_proton_app.rb
-  #
-  class Transport
-
-# @private
-include Util::Engine
-
-# Turn logging off entirely.
-TRACE_OFF = Cproton::PN_TRACE_OFF
-# Log raw binary data into/out of the transport.
-TRACE_RAW = Cproton::PN_TRACE_RAW
-# Log frames into/out of the transport.
-TRACE_FRM = Cproton::PN_TRACE_FRM
-# Log driver related events; i.e., initialization, end of stream, etc.
-TRACE_DRV = Cproton::PN_TRACE_DRV
-
-# @private
-CLIENT = 1
-# @private
-SERVER = 2
-
-# @private
-include Util::SwigHelper
-
-# @private
-PROTON_METHOD_PREFIX = "pn_transport"
-
-# @!attribute channel_max
-#
-# @return [Fixnum] The maximum allowed channel.
-#
-proton_accessor :channel_max
-
-# @!attribute [r] remote_channel_max
-#
-# @return [Fixnum] The maximum allowed channel of a transport's remote 
peer.
-#
-proton_caller :remote_channel_max
-
-# @!attribute max_frame_size
-#
-# @return [Fixnum] The maximum frame size.
-#
-proton_accessor :max_frame_size
-
-# @!attribute [r] remote_max_frame_size
-#
-# @return [Fixnum] The maximum frame size of the transport's remote peer.
-#
-proton_reader :remote_max_frame_size
-
-# @!attribute idle_timeout
-#
-# @return [Fixnum] The idle timeout.
-#
-proton_accessor :idle_timeout
-
-# @!attribute [r] remote_idle_timeout
-#
-# @return [Fixnum] The idle timeout for the transport's remote peer.
-#
-proton_accessor :remote_idle_timeout
-
-# @!attribute [r] capacity
-#
-# If the engine is in an exception state such as encountering an error
-# condition or reaching the end of stream state, a negative value will
-# be returned indicating the condition.
-#
-# If an error is indicated, further deteails can be obtained from
-# #error.
-#
-# Calls to #process may alter the value of this value. See #process for
-# more details
-#
-# @return [Fixnum] The amount of free space for input following the
-# transport's tail pointer.
-#
-proton_caller :capacity
-
-# @!attribute [r] head
-#
-# 

[48/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/examples/c/proactor/CMakeLists.txt
--
diff --git a/examples/c/proactor/CMakeLists.txt 
b/examples/c/proactor/CMakeLists.txt
deleted file mode 100644
index f701651..000
--- a/examples/c/proactor/CMakeLists.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you 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.
-#
-
-find_package(Proton REQUIRED)
-
-include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${Proton_INCLUDE_DIRS})
-
-add_definitions(${COMPILE_WARNING_FLAGS} ${WERROR} ${COMPILE_PLATFORM_FLAGS} 
${LINK_TIME_OPTIMIZATION})
-
-find_package(Libuv)
-if (Libuv_FOUND)
-  foreach(name broker send receive)
-add_executable(libuv_${name} ${name}.c libuv_proactor.c)
-target_link_libraries(libuv_${name} ${Proton_LIBRARIES} ${Libuv_LIBRARIES})
-set_target_properties(libuv_${name} PROPERTIES
-  COMPILE_DEFINITIONS  "PN_PROACTOR_INCLUDE=\"libuv_proactor.h\"")
-  endforeach()
-
-  # Add a test with the correct environment to find test executables and 
valgrind.
-  if(WIN32)
-set(test_path 
"$;$")
-  else(WIN32)
-set(test_path "${CMAKE_CURRENT_BINARY_DIR}:$ENV{PATH}")
-  endif(WIN32)
-  set(run_env ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/proton-c/env.py 
${EXAMPLE_ENV} "PATH=${test_path}" ${VALGRIND_ENV})
-  add_test(c-proactor-libuv ${run_env} -- ${PYTHON_EXECUTABLE} 
${CMAKE_CURRENT_SOURCE_DIR}/test.py)
-endif()

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/examples/c/proactor/README.dox
--
diff --git a/examples/c/proactor/README.dox b/examples/c/proactor/README.dox
deleted file mode 100644
index 4b09cb7..000
--- a/examples/c/proactor/README.dox
+++ /dev/null
@@ -1,17 +0,0 @@
-/**
- * @example send.c
- *
- * Send a fixed number of messages to the "example" node.
- *
- * @example receive.c
- *
- * Subscribes to the 'example' node and prints the message bodies
- * received.
- *
- * @example broker.c
- *
- * A simple multithreaded broker that works with the send and receive
- * examples.
- *
- * __Requires C++11__
- */

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/examples/c/proactor/broker.c
--
diff --git a/examples/c/proactor/broker.c b/examples/c/proactor/broker.c
deleted file mode 100644
index ca52336..000
--- a/examples/c/proactor/broker.c
+++ /dev/null
@@ -1,488 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include 
-#include 
-#include 
-#include 
-
-/* TODO aconway 2016-10-14: this example does not require libuv IO,
-   it uses uv.h only for portable mutex and thread functions.
-*/
-#include 
-
-bool enable_debug = false;
-
-void debug(const char* fmt, ...) {
-  if (enable_debug) {
-va_list(ap);
-va_start(ap, fmt);
-vfprintf(stderr, fmt, ap);
-fputc('\n', stderr);
-fflush(stderr);
-  }
-}
-
-void check(int err, const char* s) {
-  if (err != 0) {
-perror(s);
-exit(1);
-  }
-}
-
-void pcheck(int err, const char* s) {
-  if (err != 0) {
-fprintf(stderr, "%s: %s", s, pn_code(err));
-exit(1);
-  }
-}
-
-/* Simple re-sizable vector that acts as a queue */
-#define VEC(T) struct { T* data; size_t len, cap; }
-
-#define VEC_INIT(V) \
-  do {  

[23/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/bindings/php/get_include_dir.php
--
diff --git a/proton-c/bindings/php/get_include_dir.php 
b/proton-c/bindings/php/get_include_dir.php
deleted file mode 100644
index 6103e41..000
--- a/proton-c/bindings/php/get_include_dir.php
+++ /dev/null
@@ -1,55 +0,0 @@
-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.
- *
-*/
-
-
-$prefix = $argv[1];
-$include_path = ini_get("include_path");
-
-$php_dir = null;
-$pear_dir = null;
-$abs_dir = null;
-
-foreach (explode(PATH_SEPARATOR, $include_path) as $include_dir) {
-  if (strpos($include_dir, ".") === false &&
-  strpos($include_dir, $prefix) === 0) {
-$abs_dir = $include_dir;
-$suffix = substr($abs_dir, strlen($prefix));
-if (strpos($suffix, "php") !== false) {
-  $php_dir = $abs_dir;
-}
-if (strpos($suffix, "pear") !== false) {
-  $pear_dir = $abs_dir;
-}
-  }
-}
-
-if ($php_dir) {
-  print $php_dir;
-} else if ($pear_dir) {
-  print $pear_dir;
-} else if ($abs_dir) {
-  print $abs_dir;
-}
-
-print "\n";
-
-?>

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/bindings/php/php.i
--
diff --git a/proton-c/bindings/php/php.i b/proton-c/bindings/php/php.i
deleted file mode 100644
index 6e927f7..000
--- a/proton-c/bindings/php/php.i
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- */
-
-%module cproton
-
-// provided by SWIG development libraries
-%include php.swg
-
-#if SWIG_VERSION < 0x02
-%include compat.swg
-#endif
-
-%header %{
-/* Include the headers needed by the code in this wrapper file */
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#define zend_error_noreturn zend_error
-%}
-
-%apply (char *STRING, int LENGTH) { (char *STRING, size_t LENGTH) };
-
-// ssize_t return value
-//
-%typemap(out) ssize_t {
-ZVAL_LONG($result, (long)$1);
-}
-
-// (char **OUTPUT_BUFFER, ssize_t *OUTPUT_LEN)
-//
-// typemap for binary buffer output arguments.  Given an uninitialized pointer 
for a
-// buffer (OUTPUT_BUFFER) and a pointer to an un-initialized size/error 
(OUTPUT_LEN), a buffer
-// will be allocated and filled with binary data. *OUTPUT_BUFFER will be set 
to the address
-// of the allocated buffer.  *OUTPUT_LEN will be set to the size of the data.  
The maximum
-// length of the buffer must be provided by a separate argument.
-//
-// The return value is an array, with [0] set to the length of the output 
buffer OR an
-// error code and [1] set to the returned string object.  This value is 
appended to the
-// function's return value (also an array).
-//
-%typemap(in,numinputs=0) (char **OUTPUT_BUFFER, ssize_t *OUTPUT_LEN) (char 
*Buff = 0, ssize_t outLen = 0) {
-// setup locals for output.
-$1 = 
-$2 = 
-}
-%typemap(argout,fragment="t_output_helper") (char **OUTPUT_BUFFER, ssize_t 
*OUTPUT_LEN) {
-// convert to array: [0]=len||error, [1]=binary string
-zval *tmp;
-ALLOC_INIT_ZVAL(tmp);
-array_init(tmp);
-ssize_t len = *($2);
-add_next_index_long(tmp, len); // write the len|error code
-if (len >= 0) {
-add_next_index_stringl(tmp, *($1), len, 0);  // 0 == take ownership of 
$1 memory
-} else {
-add_next_index_string(tmp, "", 1);// 1 = strdup the ""
-}
-t_output_helper(&$result, tmp); // append it to output array
-}
-
-%typemap(in) pn_bytes_t {
-  if (ZVAL_IS_NULL(*$input)) {
-$1.start = NULL;
-$1.size = 0;
-  } else {
-$1.start = Z_STRVAL_PP($input);
-$1.size = Z_STRLEN_PP($input);
-  }
-}
-
-%typemap(out) pn_bytes_t {
-  ZVAL_STRINGL($result, $1.start, $1.size, 1);
-}
-
-%typemap(in) pn_uuid_t 

[03/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/src/core/transport.h
--
diff --git a/proton-c/src/core/transport.h b/proton-c/src/core/transport.h
deleted file mode 100644
index 66ebc51..000
--- a/proton-c/src/core/transport.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifndef _PROTON_TRANSPORT_INTERNAL_H
-#define _PROTON_TRANSPORT_INTERNAL_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- *
- */
-
-void pn_delivery_map_init(pn_delivery_map_t *db, pn_sequence_t next);
-void pn_delivery_map_del(pn_delivery_map_t *db, pn_delivery_t *delivery);
-void pn_delivery_map_free(pn_delivery_map_t *db);
-void pn_unmap_handle(pn_session_t *ssn, pn_link_t *link);
-void pn_unmap_channel(pn_transport_t *transport, pn_session_t *ssn);
-
-#endif /* transport.h */

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/src/core/types.c
--
diff --git a/proton-c/src/core/types.c b/proton-c/src/core/types.c
deleted file mode 100644
index dbd18d0..000
--- a/proton-c/src/core/types.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- *
- */
-
-#include 
-
-pn_bytes_t pn_bytes(size_t size, const char *start)
-{
-  pn_bytes_t bytes = {size, start};
-  return bytes;
-}
-
-pn_rwbytes_t pn_rwbytes(size_t size, char *start)
-{
-  pn_rwbytes_t bytes = {size, start};
-  return bytes;
-}

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/src/core/util.c
--
diff --git a/proton-c/src/core/util.c b/proton-c/src/core/util.c
deleted file mode 100644
index 62eec9a..000
--- a/proton-c/src/core/util.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- *
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include "util.h"
-
-ssize_t pn_quote_data(char *dst, size_t capacity, const char *src, size_t size)
-{
-  int idx = 0;
-  for (unsigned i = 0; i < size; i++)
-  {
-uint8_t c = src[i];
-if (isprint(c)) {
-  if (idx < (int) (capacity - 1)) {
-dst[idx++] = c;
-  } else {
-if (idx > 0) {
-  dst[idx - 1] = '\0';
-}
-return PN_OVERFLOW;
-  }
-} else {
-  if (idx < (int) (capacity - 4)) {
-idx += sprintf(dst + idx, "\\x%.2x", c);
-  } else {
-if (idx > 0) {
-  dst[idx - 1] = '\0';
-}
-return PN_OVERFLOW;
-  }
-}
-  }
-
-  dst[idx] = '\0';
-  return idx;
-}
-
-int 

[26/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/bindings/javascript/message.js
--
diff --git a/proton-c/bindings/javascript/message.js 
b/proton-c/bindings/javascript/message.js
deleted file mode 100644
index 40b15f2..000
--- a/proton-c/bindings/javascript/message.js
+++ /dev/null
@@ -1,840 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- *
- */
-
-/*/
-/*   */
-/*  Message  */
-/*   */
-/*/
-
-/**
- * Constructs a proton.Message instance.
- * @classdesc This class is a mutable holder of message content that may be 
used
- * to generate and encode or decode and access AMQP formatted message data.
- * @constructor proton.Message
- * @property {object} instructions delivery instructions for the message.
- * @property {object} annotations infrastructure defined message annotations.
- * @property {object} properties application defined message properties.
- * @property {object} body message body as a native JavaScript Object.
- * @property {object} data message body as a proton.Data Object.
- */
-Module['Message'] = function() { // Message Constructor.
-this._message = _pn_message();
-this._id = new Data(_pn_message_id(this._message));
-this._correlationId = new Data(_pn_message_correlation_id(this._message));
-
-// * Public properties 
-
-// Intitialise with an empty Object so we can set properties in a natural 
way.
-// message.properties.prop1 = "foo";
-// message.properties.prop2 = "bar";
-this['properties'] = {};
-
-/**
-// The properties may be used, but are initially undefined.
-this['instructions'];
-this['annotations'];
-this['body'];
-this['data'];
- */
-};
-
-// Expose constructor as package scope variable to make internal calls less 
verbose.
-var Message = Module['Message'];
-
-// Expose prototype as a variable to make method declarations less verbose.
-var _Message_ = Message.prototype;
-
-// ** Class properties 
-
-Message['DEFAULT_PRIORITY'] = 4; /** Default priority for messages.*/
-
-// * Protected methods 
-
-// We use the dot notation rather than associative array form for protected
-// methods so they are visible to this "package", but the Closure compiler will
-// minify and obfuscate names, effectively making a defacto "protected" method.
-
-/**
- * This helper method checks the supplied error code, converts it into an
- * exception and throws the exception. This method will try to use the message
- * populated in pn_message_error(), if present, but if not it will fall
- * back to using the basic error code rendering from pn_code().
- * @param code the error code to check.
- */
-_Message_._check = function(code) {
-if (code < 0) {
-var errno = this['getErrno']();
-var message = errno ? this['getError']() : 
Pointer_stringify(_pn_code(code));
-
-throw new Module['MessageError'](message);
-} else {
-return code;
-}
-};
-
-/**
- * Encode the Message prior to sending on the wire.
- */
-_Message_._preEncode = function() {
-// A Message Object may be reused so we create new Data instances and clear
-// the state for them each time put() gets called.
-var inst = new Data(_pn_message_instructions(this._message));
-var ann = new Data(_pn_message_annotations(this._message));
-var props = new Data(_pn_message_properties(this._message));
-var body = new Data(_pn_message_body(this._message));
-
-inst.clear();
-if (this['instructions'] !== undefined) {
-inst['putObject'](this['instructions']);
-}
-
-ann.clear();
-if (this['annotations'] !== undefined) {
-

[55/55] qpid-proton-j git commit: PROTON-1362: remove previously-deprecated Messenger

2017-01-10 Thread robbie
PROTON-1362: remove previously-deprecated Messenger


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton-j/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton-j/commit/2afe2ec0
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton-j/tree/2afe2ec0
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton-j/diff/2afe2ec0

Branch: refs/heads/master
Commit: 2afe2ec099d8154a3f1f843d3e62246dbc50c016
Parents: 2f85988
Author: Robert Gemmell 
Authored: Tue Jan 10 15:55:05 2017 +
Committer: Robert Gemmell 
Committed: Tue Jan 10 15:55:05 2017 +

--
 docs/markdown/index.md  |   27 -
 .../messenger/addressing-and-routing.md |  210 ---
 docs/markdown/messenger/index.md|   13 -
 docs/markdown/messenger/message-disposition.md  |  196 ---
 docs/markdown/messenger/quick-start-linux.md|   73 -
 .../markdown/messenger/sending-and-receiving.md |  144 --
 examples/java/messenger/README.txt  |   22 -
 examples/java/messenger/pom.xml |   41 -
 examples/java/messenger/recv|   31 -
 examples/java/messenger/send|   29 -
 .../org/apache/qpid/proton/example/Recv.java|  133 --
 .../org/apache/qpid/proton/example/Send.java|  104 --
 pom.xml |1 -
 .../java/org/apache/qpid/proton/Proton.java |   30 -
 .../apache/qpid/proton/driver/Connector.java|  127 --
 .../org/apache/qpid/proton/driver/Driver.java   |  160 --
 .../org/apache/qpid/proton/driver/Listener.java |   61 -
 .../qpid/proton/driver/impl/ConnectorImpl.java  |  280 
 .../qpid/proton/driver/impl/DriverImpl.java |  254 ---
 .../qpid/proton/driver/impl/ListenerImpl.java   |   93 --
 .../apache/qpid/proton/messenger/Messenger.java |  285 
 .../proton/messenger/MessengerException.java|   51 -
 .../apache/qpid/proton/messenger/Status.java|   37 -
 .../apache/qpid/proton/messenger/Tracker.java   |   28 -
 .../qpid/proton/messenger/impl/Address.java |  220 ---
 .../proton/messenger/impl/MessengerImpl.java| 1555 --
 .../qpid/proton/messenger/impl/Store.java   |  213 ---
 .../qpid/proton/messenger/impl/StoreEntry.java  |  185 ---
 .../qpid/proton/messenger/impl/TrackerImpl.java |   58 -
 .../qpid/proton/messenger/impl/Transform.java   |  150 --
 .../qpid/proton/reactor/impl/AcceptorImpl.java  |1 -
 .../qpid/proton/reactor/impl/Address.java   |  219 +++
 .../qpid/proton/reactor/impl/IOHandler.java |1 -
 .../qpid/proton/reactor/impl/ReactorImpl.java   |1 -
 .../qpid/proton/messenger/impl/AddressTest.java |   68 -
 .../qpid/proton/reactor/impl/AddressTest.java   |   68 +
 tests/java/pythonTests.ignore   |3 -
 tests/java/shim/binding/proton/__init__.py  |  618 ---
 tests/java/shim/cmessenger.py   |  225 ---
 tests/java/shim/cproton.py  |1 -
 tests/java/shim/curl.py |2 +-
 tests/python/proton_tests/__init__.py   |2 -
 tests/python/proton_tests/common.py |  305 
 tests/python/proton_tests/messenger.py  | 1091 
 tests/python/proton_tests/soak.py   |  368 -
 tests/python/proton_tests/ssl.py|  211 ---
 46 files changed, 288 insertions(+), 7707 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2afe2ec0/docs/markdown/index.md
--
diff --git a/docs/markdown/index.md b/docs/markdown/index.md
deleted file mode 100644
index 5262c44..000
--- a/docs/markdown/index.md
+++ /dev/null
@@ -1,27 +0,0 @@
-
-Proton is a library for speaking AMQP, including:
-
-- The AMQP [Messenger API](messenger/index.html), a simple but powerful 
interface to send and receive
-  messages over AMQP.
-- The [AMQP Protocol Engine](engine/engine.html), a succinct encapsulation of 
the full
-  AMQP protocol machinery.
-
-Proton is designed for maximum embeddability:
-
-- minimal dependencies
-- minimal assumptions about application threading model
-
-Proton is designed to scale up and down:
-
-- transparently supports both simple peer to peer messaging and complex
-globally federated topologies
-
-Proton is multi-lingual:
-
-- Proton-C - a C implementation with lanuage bindings in Python, Php, Perl,
-Ruby, and Java (via JNI).
-- Proton-J - a pure Java implementation
-
-Please see http://qpid.apache.org/proton for a more info.
-
-

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2afe2ec0/docs/markdown/messenger/addressing-and-routing.md
--
diff --git a/docs/markdown/messenger/addressing-and-routing.md 

[38/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/bindings/cpp/include/proton/codec/encoder.hpp
--
diff --git a/proton-c/bindings/cpp/include/proton/codec/encoder.hpp 
b/proton-c/bindings/cpp/include/proton/codec/encoder.hpp
deleted file mode 100644
index 222e95b..000
--- a/proton-c/bindings/cpp/include/proton/codec/encoder.hpp
+++ /dev/null
@@ -1,202 +0,0 @@
-#ifndef PROTON_CODEC_ENCODER_HPP
-#define PROTON_CODEC_ENCODER_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- *
- */
-
-#include "../internal/data.hpp"
-#include "../internal/type_traits.hpp"
-#include "../types_fwd.hpp"
-#include "./common.hpp"
-
-#include 
-
-namespace proton {
-class scalar_base;
-
-namespace internal{
-class value_base;
-}
-
-namespace codec {
-
-/// **Experimental** - Stream-like encoder from C++ values to AMQP
-/// bytes.
-///
-/// For internal use only.
-///
-/// @see @ref types_page for the recommended ways to manage AMQP data
-class encoder : public internal::data {
-  public:
-/// Wrap Proton-C data object.
-explicit encoder(const data& d) : data(d) {}
-
-/// Encoder into v. Clears any current value in v.
-PN_CPP_EXTERN explicit encoder(internal::value_base& v);
-
-/// Encode the current values into buffer and update size to reflect the
-/// number of bytes encoded.
-///
-/// Clears the encoder.
-///
-/// @return if buffer == 0 or size is too small, then return false
-/// and size to the required size.  Otherwise, return true and set
-/// size to the number of bytes encoded.
-PN_CPP_EXTERN bool encode(char* buffer, size_t& size);
-
-/// Encode the current values into a std::string and resize the
-/// string if necessary. Clears the encoder.
-PN_CPP_EXTERN void encode(std::string&);
-
-/// Encode the current values into a std::string. Clears the
-/// encoder.
-PN_CPP_EXTERN std::string encode();
-
-/// @name Insert built-in types
-/// @{
-PN_CPP_EXTERN encoder& operator<<(bool);
-PN_CPP_EXTERN encoder& operator<<(uint8_t);
-PN_CPP_EXTERN encoder& operator<<(int8_t);
-PN_CPP_EXTERN encoder& operator<<(uint16_t);
-PN_CPP_EXTERN encoder& operator<<(int16_t);
-PN_CPP_EXTERN encoder& operator<<(uint32_t);
-PN_CPP_EXTERN encoder& operator<<(int32_t);
-PN_CPP_EXTERN encoder& operator<<(wchar_t);
-PN_CPP_EXTERN encoder& operator<<(uint64_t);
-PN_CPP_EXTERN encoder& operator<<(int64_t);
-PN_CPP_EXTERN encoder& operator<<(timestamp);
-PN_CPP_EXTERN encoder& operator<<(float);
-PN_CPP_EXTERN encoder& operator<<(double);
-PN_CPP_EXTERN encoder& operator<<(decimal32);
-PN_CPP_EXTERN encoder& operator<<(decimal64);
-PN_CPP_EXTERN encoder& operator<<(decimal128);
-PN_CPP_EXTERN encoder& operator<<(const uuid&);
-PN_CPP_EXTERN encoder& operator<<(const std::string&);
-PN_CPP_EXTERN encoder& operator<<(const symbol&);
-PN_CPP_EXTERN encoder& operator<<(const binary&);
-PN_CPP_EXTERN encoder& operator<<(const scalar_base&);
-PN_CPP_EXTERN encoder& operator<<(const null&);
-/// @}
-
-/// Insert a proton::value.
-///
-/// @internal NOTE insert value_base, not value to avoid recursive
-/// implicit conversions.
-PN_CPP_EXTERN encoder& operator<<(const internal::value_base&);
-
-/// Start a complex type
-PN_CPP_EXTERN encoder& operator<<(const start&);
-
-/// Finish a complex type
-PN_CPP_EXTERN encoder& operator<<(const finish&);
-
-/// @cond INTERNAL
-
-// Undefined template to  prevent pointers being implicitly converted to 
bool.
-template  void* operator<<(const T*);
-
-template  struct list_cref { T& ref; list_cref(T& r) : ref(r) {} 
};
-template  struct map_cref { T& ref;  map_cref(T& r) : ref(r) {} };
-
-template  struct array_cref {
-start array_start;
-T& ref;
-array_cref(T& r, type_id el, bool described) : array_start(ARRAY, el, 
described), ref(r) {}
-};
-
-template  static list_cref list(T& x) { return 
list_cref(x); }
-template  static map_cref map(T& x) { return map_cref(x); }
-template  

[06/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/src/core/engine.c
--
diff --git a/proton-c/src/core/engine.c b/proton-c/src/core/engine.c
deleted file mode 100644
index 8c2aeb0..000
--- a/proton-c/src/core/engine.c
+++ /dev/null
@@ -1,2277 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- *
- */
-
-#include "engine-internal.h"
-#include 
-#include 
-#include "protocol.h"
-
-#include 
-#include 
-#include 
-
-#include "platform/platform.h"
-#include "platform/platform_fmt.h"
-#include "transport.h"
-
-static void pni_session_bound(pn_session_t *ssn);
-static void pni_link_bound(pn_link_t *link);
-
-
-// endpoints
-
-static pn_connection_t *pni_ep_get_connection(pn_endpoint_t *endpoint)
-{
-  switch (endpoint->type) {
-  case CONNECTION:
-return (pn_connection_t *) endpoint;
-  case SESSION:
-return ((pn_session_t *) endpoint)->connection;
-  case SENDER:
-  case RECEIVER:
-return ((pn_link_t *) endpoint)->session->connection;
-  }
-
-  return NULL;
-}
-
-static pn_event_type_t endpoint_event(pn_endpoint_type_t type, bool open) {
-  switch (type) {
-  case CONNECTION:
-return open ? PN_CONNECTION_LOCAL_OPEN : PN_CONNECTION_LOCAL_CLOSE;
-  case SESSION:
-return open ? PN_SESSION_LOCAL_OPEN : PN_SESSION_LOCAL_CLOSE;
-  case SENDER:
-  case RECEIVER:
-return open ? PN_LINK_LOCAL_OPEN : PN_LINK_LOCAL_CLOSE;
-  default:
-assert(false);
-return PN_EVENT_NONE;
-  }
-}
-
-static void pn_endpoint_open(pn_endpoint_t *endpoint)
-{
-  if (!(endpoint->state & PN_LOCAL_ACTIVE)) {
-PN_SET_LOCAL(endpoint->state, PN_LOCAL_ACTIVE);
-pn_connection_t *conn = pni_ep_get_connection(endpoint);
-pn_collector_put(conn->collector, PN_OBJECT, endpoint,
- endpoint_event(endpoint->type, true));
-pn_modified(conn, endpoint, true);
-  }
-}
-
-static void pn_endpoint_close(pn_endpoint_t *endpoint)
-{
-  if (!(endpoint->state & PN_LOCAL_CLOSED)) {
-PN_SET_LOCAL(endpoint->state, PN_LOCAL_CLOSED);
-pn_connection_t *conn = pni_ep_get_connection(endpoint);
-pn_collector_put(conn->collector, PN_OBJECT, endpoint,
- endpoint_event(endpoint->type, false));
-pn_modified(conn, endpoint, true);
-  }
-}
-
-void pn_connection_reset(pn_connection_t *connection)
-{
-  assert(connection);
-  pn_endpoint_t *endpoint = >endpoint;
-  endpoint->state = PN_LOCAL_UNINIT | PN_REMOTE_UNINIT;
-}
-
-void pn_connection_open(pn_connection_t *connection)
-{
-  assert(connection);
-  pn_endpoint_open(>endpoint);
-}
-
-void pn_connection_close(pn_connection_t *connection)
-{
-  assert(connection);
-  pn_endpoint_close(>endpoint);
-}
-
-static void pni_endpoint_tini(pn_endpoint_t *endpoint);
-
-void pn_connection_release(pn_connection_t *connection)
-{
-  assert(!connection->endpoint.freed);
-  // free those endpoints that haven't been freed by the application
-  LL_REMOVE(connection, endpoint, >endpoint);
-  while (connection->endpoint_head) {
-pn_endpoint_t *ep = connection->endpoint_head;
-switch (ep->type) {
-case SESSION:
-  // note: this will free all child links:
-  pn_session_free((pn_session_t *)ep);
-  break;
-case SENDER:
-case RECEIVER:
-  pn_link_free((pn_link_t *)ep);
-  break;
-default:
-  assert(false);
-}
-  }
-  connection->endpoint.freed = true;
-  if (!connection->transport) {
-// no transport available to consume transport work items,
-// so manually clear them:
-pn_ep_incref(>endpoint);
-pn_connection_unbound(connection);
-  }
-  pn_ep_decref(>endpoint);
-}
-
-void pn_connection_free(pn_connection_t *connection) {
-  pn_connection_release(connection);
-  pn_decref(connection);
-}
-
-void pn_connection_bound(pn_connection_t *connection)
-{
-  pn_collector_put(connection->collector, PN_OBJECT, connection, 
PN_CONNECTION_BOUND);
-  pn_ep_incref(>endpoint);
-
-  size_t nsessions = pn_list_size(connection->sessions);
-  for (size_t i = 0; i < nsessions; i++) {
-pni_session_bound((pn_session_t *) pn_list_get(connection->sessions, i));
-  }
-}
-
-// invoked when transport has been removed:
-void 

[20/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/bindings/python/proton/_compat.py
--
diff --git a/proton-c/bindings/python/proton/_compat.py 
b/proton-c/bindings/python/proton/_compat.py
deleted file mode 100644
index 4585dfc..000
--- a/proton-c/bindings/python/proton/_compat.py
+++ /dev/null
@@ -1,84 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you 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.
-#
-
-"""
-Utilities to help Proton support both python2 and python3.
-"""
-
-import sys
-import types
-IS_PY2 = sys.version_info[0] == 2
-IS_PY3 = sys.version_info[0] == 3
-
-if IS_PY3:
-INT_TYPES = (int,)
-TEXT_TYPES = (str,)
-STRING_TYPES = (str,)
-BINARY_TYPES = (bytes,)
-CLASS_TYPES = (type,)
-
-def raise_(t, v=None, tb=None):
-"""Mimic the old 2.x raise behavior:
-Raise an exception of type t with value v using optional traceback tb
-"""
-if v is None:
-v = t()
-if tb is None:
-raise v
-else:
-raise v.with_traceback(tb)
-
-def iteritems(d):
-return iter(d.items())
-
-def unichar(i):
-return chr(i)
-
-def str2bin(s, encoding='latin-1'):
-"""Convert str to binary type"""
-return s.encode(encoding)
-
-def str2unicode(s):
-return s
-
-else:
-INT_TYPES = (int, long)
-TEXT_TYPES = (unicode,)
-# includes both unicode and non-unicode strings:
-STRING_TYPES = (basestring,)
-BINARY_TYPES = (str,)
-CLASS_TYPES = (type, types.ClassType)
-
-# the raise syntax will cause a parse error in Py3, so 'sneak' in a
-# definition that won't cause the parser to barf
-exec("""def raise_(t, v=None, tb=None):
-raise t, v, tb
-""")
-
-def iteritems(d, **kw):
-return d.iteritems()
-
-def unichar(i):
-return unichr(i)
-
-def str2bin(s, encoding='latin-1'):
-return s
-
-def str2unicode(s):
-return unicode(s, "unicode_escape")

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/bindings/python/proton/handlers.py
--
diff --git a/proton-c/bindings/python/proton/handlers.py 
b/proton-c/bindings/python/proton/handlers.py
deleted file mode 100644
index a689e65..000
--- a/proton-c/bindings/python/proton/handlers.py
+++ /dev/null
@@ -1,637 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you 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.
-#
-import heapq, logging, os, re, socket, time, types
-
-from proton import dispatch, generate_uuid, PN_ACCEPTED, SASL, symbol, ulong, 
Url
-from proton import Collector, Connection, Delivery, Described, Endpoint, 
Event, Link, Terminus, Timeout
-from proton import Message, Handler, ProtonException, Transport, 
TransportException, ConnectionException
-from select import select
-
-
-class OutgoingMessageHandler(Handler):
-"""
-A utility for simpler and more intuitive handling of delivery
-events related to outgoing i.e. sent messages.
-"""
-def __init__(self, auto_settle=True, delegate=None):
-self.auto_settle = auto_settle
-self.delegate = delegate
-
-def on_link_flow(self, event):
-if event.link.is_sender and event.link.credit \
-   and event.link.state & Endpoint.LOCAL_ACTIVE \
-   and event.link.state & Endpoint.REMOTE_ACTIVE :
-self.on_sendable(event)
-
-def on_delivery(self, event):
-

[34/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/bindings/cpp/src/error_condition.cpp
--
diff --git a/proton-c/bindings/cpp/src/error_condition.cpp 
b/proton-c/bindings/cpp/src/error_condition.cpp
deleted file mode 100644
index ead1cff..000
--- a/proton-c/bindings/cpp/src/error_condition.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- *
- */
-#include "proton/error_condition.hpp"
-
-#include 
-
-#include "proton_bits.hpp"
-
-#include 
-
-namespace proton {
-
-error_condition::error_condition(pn_condition_t* c) :
-name_(str(pn_condition_get_name(c))),
-description_(str(pn_condition_get_description(c))),
-properties_(internal::value_ref(pn_condition_info(c)))
-{}
-
-
-error_condition::error_condition(std::string description) :
-name_("proton:io:error"),
-description_(description)
-{}
-
-error_condition::error_condition(std::string name, std::string description) :
-name_(name),
-description_(description)
-{}
-
-error_condition::error_condition(std::string name, std::string description, 
value properties) :
-name_(name),
-description_(description),
-properties_(properties)
-{}
-
-#if PN_CPP_HAS_EXPLICIT_CONVERSIONS
-error_condition::operator bool() const {
-  return !name_.empty();
-}
-#endif
-
-bool error_condition::operator!() const {
-return name_.empty();
-}
-
-bool error_condition::empty() const {
-return name_.empty();
-}
-
-std::string error_condition::name() const {
-return name_;
-}
-
-std::string error_condition::description() const {
-return description_;
-}
-
-value error_condition::properties() const {
-return properties_;
-}
-
-std::string error_condition::what() const {
-if (!*this) {
-return "No error condition";
-} else {
-  std::string s(name_);
-  if (!description_.empty()) {
-  s += ": ";
-  s += description_;
-  }
-  return s;
-}
-}
-
-bool operator==(const error_condition& x, const error_condition& y) {
-return x.name() == y.name() && x.description() == y.description()
-&& x.properties() == y.properties();
-}
-
-std::ostream& operator<<(std::ostream& o, const error_condition& err) {
-return o << err.what();
-}
-
-}

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/bindings/cpp/src/event_loop.cpp
--
diff --git a/proton-c/bindings/cpp/src/event_loop.cpp 
b/proton-c/bindings/cpp/src/event_loop.cpp
deleted file mode 100644
index ea4ee71..000
--- a/proton-c/bindings/cpp/src/event_loop.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- */
-
-#include "proton/event_loop.hpp"
-
-#include "contexts.hpp"
-#include "event_loop_impl.hpp"
-
-#include 
-#include 
-
-namespace proton {
-
-event_loop::event_loop() {}
-event_loop::~event_loop() {}
-
-event_loop& event_loop::operator=(impl* i) { impl_.reset(i); return *this; }
-
-bool event_loop::inject(void_function0& f) {
-return impl_->inject(f);
-}
-
-#if PN_CPP_HAS_STD_FUNCTION
-bool event_loop::inject(std::function f) {
-return impl_->inject(f);
-}
-#endif
-
-event_loop& event_loop::get(pn_connection_t* c) {
-return connection_context::get(c).event_loop_;
-}
-
-event_loop& event_loop::get(pn_session_t* s) {
-return 

[49/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/design/api-reconciliation/src/test/resources/org/apache/qpid/proton/apireconciliation/reportwriter/expectedmany.csv
--
diff --git 
a/design/api-reconciliation/src/test/resources/org/apache/qpid/proton/apireconciliation/reportwriter/expectedmany.csv
 
b/design/api-reconciliation/src/test/resources/org/apache/qpid/proton/apireconciliation/reportwriter/expectedmany.csv
deleted file mode 100644
index 8c8ba3e..000
--- 
a/design/api-reconciliation/src/test/resources/org/apache/qpid/proton/apireconciliation/reportwriter/expectedmany.csv
+++ /dev/null
@@ -1,5 +0,0 @@
-C function,Java Method,Java Annotation
-function1,org.apache.qpid.proton.apireconciliation.reportwriter.ReconciliationReportWriterTest#methodWithMapping,function1
-function2,org.apache.qpid.proton.apireconciliation.reportwriter.ReconciliationReportWriterTest#anotherMethodWithMapping,function2
-,org.apache.qpid.proton.apireconciliation.reportwriter.ReconciliationReportWriterTest#methodWithoutMapping,
-function4,,

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/design/api-reconciliation/src/test/resources/org/apache/qpid/proton/apireconciliation/reportwriter/expectedsingle.csv
--
diff --git 
a/design/api-reconciliation/src/test/resources/org/apache/qpid/proton/apireconciliation/reportwriter/expectedsingle.csv
 
b/design/api-reconciliation/src/test/resources/org/apache/qpid/proton/apireconciliation/reportwriter/expectedsingle.csv
deleted file mode 100644
index 082f623..000
--- 
a/design/api-reconciliation/src/test/resources/org/apache/qpid/proton/apireconciliation/reportwriter/expectedsingle.csv
+++ /dev/null
@@ -1,2 +0,0 @@
-C function,Java Method,Java Annotation
-function1,org.apache.qpid.proton.apireconciliation.reportwriter.ReconciliationReportWriterTest#methodWithMapping,function1

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/design/build.xml
--
diff --git a/design/build.xml b/design/build.xml
deleted file mode 100644
index e884b68..000
--- a/design/build.xml
+++ /dev/null
@@ -1,90 +0,0 @@
-
-
-  
-simple example build file
-  
-
-  
-  
-  
-  
-  
-  
-  
-
-  
-
-
-  
-
-  
-
-  
-
-  
-
-
-
-  
-
-
-  
-
-  
-
-
-  
-  
-  
-  
-  
-  
-
-  
-
-  
-
-
-  
-
-  
-
-  
-  
-  
-  http://download.oracle.com/javase/6/docs/api/; packagelistLoc="C:\tmp"/>
-  http://developer.java.sun.com/developer/products/xml/docs/api/"/>
-
-  
-
-  
-
-  
-
-
-
-
-
-  
-
-  
-
-
-  
-

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/design/proton_objects.dia
--
diff --git a/design/proton_objects.dia b/design/proton_objects.dia
deleted file mode 100644
index 4fc2634..000
Binary files a/design/proton_objects.dia and /dev/null differ

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/design/src/proton/Accepted.java
--
diff --git a/design/src/proton/Accepted.java b/design/src/proton/Accepted.java
deleted file mode 100644
index 246eb6c..000
--- a/design/src/proton/Accepted.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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 proton;
-
-
-/**
- * Accepted
- *
- * @hidden
- *
- */
-
-public interface Accepted extends Outcome
-{
-
-}

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/design/src/proton/Connection.java
--
diff --git a/design/src/proton/Connection.java 
b/design/src/proton/Connection.java
deleted file mode 100644
index a7f4af7..000
--- a/design/src/proton/Connection.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license 

[35/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/bindings/cpp/src/connection.cpp
--
diff --git a/proton-c/bindings/cpp/src/connection.cpp 
b/proton-c/bindings/cpp/src/connection.cpp
deleted file mode 100644
index 113932c..000
--- a/proton-c/bindings/cpp/src/connection.cpp
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- *
- */
-
-#include "proton_bits.hpp"
-
-#include "proton/connection.hpp"
-#include "proton/container.hpp"
-#include "proton/error.hpp"
-#include "proton/event_loop.hpp"
-#include "proton/receiver_options.hpp"
-#include "proton/sender_options.hpp"
-#include "proton/session.hpp"
-#include "proton/session_options.hpp"
-#include "proton/transport.hpp"
-
-#include "connector.hpp"
-#include "contexts.hpp"
-#include "msg.hpp"
-#include "proton_bits.hpp"
-
-#include 
-#include 
-#include 
-#include 
-#include 
-
-namespace proton {
-
-transport connection::transport() const {
-return make_wrapper(pn_connection_transport(pn_object()));
-}
-
-void connection::open() {
-open(connection_options());
-}
-
-void connection::open(const connection_options ) {
-opts.apply_unbound(*this);
-pn_connection_open(pn_object());
-}
-
-void connection::close() { pn_connection_close(pn_object()); }
-
-std::string connection::virtual_host() const {
-return str(pn_connection_remote_hostname(pn_object()));
-}
-
-std::string connection::container_id() const {
-return str(pn_connection_get_container(pn_object()));
-}
-
-std::string connection::user() const {
-return str(pn_transport_get_user(pn_connection_transport(pn_object(;
-}
-
-container& connection::container() const {
-class container* c = connection_context::get(pn_object()).container;
-if (!c) {
-pn_reactor_t *r = pn_object_reactor(pn_object());
-if (r)
-c = _context::get(r);
-}
-if (!c)
-throw proton::error("connection does not have a container");
-return *c;
-}
-
-session_range connection::sessions() const {
-return 
session_range(session_iterator(make_wrapper(pn_session_head(pn_object(), 0;
-}
-
-receiver_range connection::receivers() const {
-  pn_link_t *lnk = pn_link_head(pn_object(), 0);
-  while (lnk) {
-if (pn_link_is_receiver(lnk))
-  break;
-lnk = pn_link_next(lnk, 0);
-  }
-  return receiver_range(receiver_iterator(make_wrapper(lnk)));
-}
-
-sender_range connection::senders() const {
-  pn_link_t *lnk = pn_link_head(pn_object(), 0);
-  while (lnk) {
-if (pn_link_is_sender(lnk))
-  break;
-lnk = pn_link_next(lnk, 0);
-  }
-  return sender_range(sender_iterator(make_wrapper(lnk)));
-}
-
-session connection::open_session() {
-return open_session(session_options());
-}
-
-session connection::open_session(const session_options ) {
-session s(make_wrapper(pn_session(pn_object(;
-// TODO: error check, too many sessions, no mem...
-if (!!s) s.open(opts);
-return s;
-}
-
-session connection::default_session() {
-connection_context& ctx = connection_context::get(pn_object());
-if (!ctx.default_session) {
-// Note we can't use a proton::session here because we don't want to 
own
-// a session reference. The connection owns the session, owning it 
here as well
-// would create a circular ownership.
-ctx.default_session = pn_session(pn_object());
-pn_session_open(ctx.default_session);
-}
-return make_wrapper(ctx.default_session);
-}
-
-sender connection::open_sender(const std::string ) {
-return open_sender(addr, sender_options());
-}
-
-sender connection::open_sender(const std::string , const sender_options 
) {
-return default_session().open_sender(addr, opts);
-}
-
-receiver connection::open_receiver(const std::string ) {
-return open_receiver(addr, receiver_options());
-}
-
-receiver connection::open_receiver(const std::string , const 
receiver_options )
-{
-return default_session().open_receiver(addr, opts);
-}
-
-error_condition connection::error() const {
-return make_wrapper(pn_connection_remote_condition(pn_object()));
-}
-
-uint32_t 

[47/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/examples/c/reactor/sender.c
--
diff --git a/examples/c/reactor/sender.c b/examples/c/reactor/sender.c
deleted file mode 100644
index 6c3cdb3..000
--- a/examples/c/reactor/sender.c
+++ /dev/null
@@ -1,329 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- *
- */
-
-#include 
-#include 
-#include 
-
-#include "pncompat/misc_funcs.inc"
-
-#include "proton/reactor.h"
-#include "proton/message.h"
-#include "proton/connection.h"
-#include "proton/session.h"
-#include "proton/link.h"
-#include "proton/delivery.h"
-#include "proton/event.h"
-#include "proton/handlers.h"
-#include "proton/transport.h"
-#include "proton/url.h"
-
-
-static int quiet = 0;
-
-// Example application data.  This data will be instantiated in the event
-// handler, and is available during event processing.  In this example it
-// holds configuration and state information.
-//
-typedef struct {
-int count;   // # messages to send
-int anon;// use anonymous link if true
-const char *target;  // name of destination target
-char *msg_data;  // pre-encoded outbound message
-size_t msg_len;  // bytes in msg_data
-} app_data_t;
-
-// helper to pull pointer to app_data_t instance out of the pn_handler_t
-//
-#define GET_APP_DATA(handler) ((app_data_t *)pn_handler_mem(handler))
-
-// Called when reactor exits to clean up app_data
-//
-static void delete_handler(pn_handler_t *handler)
-{
-app_data_t *d = GET_APP_DATA(handler);
-if (d->msg_data) {
-free(d->msg_data);
-d->msg_data = NULL;
-}
-}
-
-/* Process each event posted by the reactor.
- */
-static void event_handler(pn_handler_t *handler,
-  pn_event_t *event,
-  pn_event_type_t type)
-{
-app_data_t *data = GET_APP_DATA(handler);
-
-switch (type) {
-
-case PN_CONNECTION_INIT: {
-// Create and open all the endpoints needed to send a message
-//
-pn_connection_t *conn;
-pn_session_t *ssn;
-pn_link_t *sender;
-
-conn = pn_event_connection(event);
-pn_connection_open(conn);
-ssn = pn_session(conn);
-pn_session_open(ssn);
-sender = pn_sender(ssn, "MySender");
-// we do not wait for ack until the last message
-pn_link_set_snd_settle_mode(sender, PN_SND_MIXED);
-if (!data->anon) {
-pn_terminus_set_address(pn_link_target(sender), data->target);
-}
-pn_link_open(sender);
-} break;
-
-case PN_LINK_FLOW: {
-// the remote has given us some credit, now we can send messages
-//
-static long tag = 0;  // a simple tag generator
-pn_delivery_t *delivery;
-pn_link_t *sender = pn_event_link(event);
-int credit = pn_link_credit(sender);
-while (credit > 0 && data->count > 0) {
---credit;
---data->count;
-++tag;
-delivery = pn_delivery(sender,
-   pn_dtag((const char *), sizeof(tag)));
-pn_link_send(sender, data->msg_data, data->msg_len);
-pn_link_advance(sender);
-if (data->count > 0) {
-// send pre-settled until the last one, then wait for an ack on
-// the last sent message. This allows the sender to send
-// messages as fast as possible and then exit when the consumer
-// has dealt with the last one.
-//
-pn_delivery_settle(delivery);
-}
-}
-} break;
-
-case PN_DELIVERY: {
-// Since the example sends all messages but the last pre-settled
-// (pre-acked), only the last message's delivery will get updated with
-// the remote state (acked/nacked).
-//
-pn_delivery_t *dlv = pn_event_delivery(event);
-if (pn_delivery_updated(dlv) && pn_delivery_remote_state(dlv)) {
-uint64_t rs = pn_delivery_remote_state(dlv);
-int done = 1;
-switch (rs) {
-case PN_RECEIVED:

[29/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/bindings/go/src/qpid.apache.org/proton/handlers.go
--
diff --git a/proton-c/bindings/go/src/qpid.apache.org/proton/handlers.go 
b/proton-c/bindings/go/src/qpid.apache.org/proton/handlers.go
deleted file mode 100644
index 961136e..000
--- a/proton-c/bindings/go/src/qpid.apache.org/proton/handlers.go
+++ /dev/null
@@ -1,395 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you 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 proton
-
-import "fmt"
-
-// EventHandler handles core proton events.
-type EventHandler interface {
-   // HandleEvent is called with an event.
-   // Typically HandleEvent() is implemented as a switch on e.Type()
-   // Returning an error will stop the Engine.
-   HandleEvent(e Event)
-}
-
-// MessagingHandler provides an alternative interface to EventHandler.
-// it is easier to use for most applications that send and receive messages.
-//
-// Implement this interface and then wrap your value with a 
MessagingHandlerDelegator.
-// MessagingHandlerDelegator implements EventHandler and can be registered 
with a Engine.
-//
-type MessagingHandler interface {
-   // HandleMessagingEvent is called with  MessagingEvent.
-   // Typically HandleEvent() is implemented as a switch on e.Type()
-   // Returning an error will stop the Engine.
-   HandleMessagingEvent(MessagingEvent, Event)
-}
-
-// MessagingEvent provides a set of events that are easier to work with than 
the
-// core events defined by EventType
-//
-// There are 3 types of "endpoint": Connection, Session and Link.  For each
-// endpoint there are 5 events: Opening, Opened, Closing, Closed and Error.
-//
-// The meaning of these events is as follows:
-//
-// Opening: The remote end opened, the local end will open automatically.
-//
-// Opened: Both ends are open, regardless of which end opened first.
-//
-// Closing: The remote end closed without error, the local end will close 
automatically.
-//
-// Error: The remote end closed with an error, the local end will close 
automatically.
-//
-// Closed: Both ends are closed, regardless of which end closed first or if 
there was an error.
-// No further events will be received for the endpoint.
-//
-type MessagingEvent int
-
-const (
-   // The event loop starts.
-   MStart MessagingEvent = iota
-   // The peer closes the connection with an error condition.
-   MConnectionError
-   // The peer closes the session with an error condition.
-   MSessionError
-   // The peer closes the link with an error condition.
-   MLinkError
-   // The peer Initiates the opening of the connection.
-   MConnectionOpening
-   // The peer initiates the opening of the session.
-   MSessionOpening
-   // The peer initiates the opening of the link.
-   MLinkOpening
-   // The connection is opened.
-   MConnectionOpened
-   // The session is opened.
-   MSessionOpened
-   // The link is opened.
-   MLinkOpened
-   // The peer initiates the closing of the connection.
-   MConnectionClosing
-   // The peer initiates the closing of the session.
-   MSessionClosing
-   // The peer initiates the closing of the link.
-   MLinkClosing
-   // Both ends of the connection are closed.
-   MConnectionClosed
-   // Both ends of the session are closed.
-   MSessionClosed
-   // Both ends of the link are closed.
-   MLinkClosed
-   // The sender link has credit and messages can
-   // therefore be transferred.
-   MSendable
-   // The remote peer accepts an outgoing message.
-   MAccepted
-   // The remote peer rejects an outgoing message.
-   MRejected
-   // The peer releases an outgoing message. Note that this may be in 
response to
-   // either the RELEASE or MODIFIED state as defined by the AMQP 
specification.
-   MReleased
-   // The peer has settled the outgoing message. This is the point at 
which it
-   // should never be re-transmitted.
-   MSettled
-   // A message is received. Call Event.Delivery().Message() to decode as 
an amqp.Message.
-   // To manage the 

[13/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/include/proton/connection_driver.h
--
diff --git a/proton-c/include/proton/connection_driver.h 
b/proton-c/include/proton/connection_driver.h
deleted file mode 100644
index b34376d..000
--- a/proton-c/include/proton/connection_driver.h
+++ /dev/null
@@ -1,251 +0,0 @@
-#ifndef PROTON_CONNECTION_DRIVER_H
-#define PROTON_CONNECTION_DRIVER_H 1
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- */
-
-/**
- * @file
- *
- * @copybrief connection_driver
- *
- * Associate a @ref connection and @ref transport with AMQP byte
- * streams from any source.
- *
- * - process AMQP-encoded bytes from some input byte stream
- * - generate ::pn_event_t events for your application to handle
- * - encode resulting AMQP output bytes for some output byte stream
- *
- * The pn_connection_driver_() functions provide a simplified API and
- * extra logic to use ::pn_connection_t and ::pn_transport_t as a
- * unit.  You can also access them directly for features that do not
- * have pn_connection_driver_() functions.
- *
- * The driver buffers events and data, you should run it until
- * pn_connection_driver_finished() is true, to ensure all reading,
- * writing and event handling (including ERROR and FINAL events) is
- * finished.
- *
- * ## Error handling
- *
- * The pn_connection_driver_*() functions do not return an error
- * code. IO errors set the transport condition and are returned as a
- * PN_TRANSPORT_ERROR. The integration code can set errors using
- * pn_connection_driver_errorf().
- *
- * ## IO patterns
- *
- * This API supports asynchronous, proactive, non-blocking and
- * reactive IO. An integration does not have to follow the
- * dispatch-read-write sequence above, but note that you should handle
- * all available events before calling
- * pn_connection_driver_read_buffer() and check that `size` is
- * non-zero before starting a blocking or asynchronous read call. A
- * `read` started while there are unprocessed CLOSE events in the
- * buffer may never complete.
- *
- * AMQP is a full-duplex, asynchronous protocol. The "read" and
- * "write" sides of an AMQP connection can close separately.
- *
- * ## Thread safety
- *
- * The @ref connection_driver types are not thread safe, but each
- * connection and its associated types forms an independent
- * unit. Different connections can be processed concurrently by
- * different threads.
- *
- * @addtogroup connection_driver
- * @{
- */
-
-#include 
-#include 
-#include 
-
-#include 
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * The elements needed to drive AMQP IO and events.
- */
-typedef struct pn_connection_driver_t {
-  pn_connection_t *connection;
-  pn_transport_t *transport;
-  pn_event_batch_t batch;
-} pn_connection_driver_t;
-
-/**
- * Set connection and transport to the provided values, or create a new
- * @ref pn_connection_t or @ref pn_transport_t if either is NULL.
- * The provided values belong to the connection driver and will be freed by
- * pn_connection_driver_destroy()
- *
- * The transport is bound automatically after the PN_CONNECTION_INIT has been 
is
- * handled by the application. It can be bound earlier with
- * pn_connection_driver_bind().
- *
- * The following functions must be called before the transport is
- * bound to have effect: pn_connection_set_username(), 
pn_connection_set_password(),
- * pn_transport_set_server()
- *
- * @return PN_OUT_OF_MEMORY if any allocation fails.
- */
-PN_EXTERN int pn_connection_driver_init(pn_connection_driver_t*, 
pn_connection_t*, pn_transport_t*);
-
-/** Force binding of the transport.
- * This happens automatically after the PN_CONNECTION_INIT is processed.
- *
- * @return PN_STATE_ERR if the transport is already bound.
- */
-PN_EXTERN int pn_connection_driver_bind(pn_connection_driver_t *d);
-
-/**
- * Unbind, release and free the connection and transport. Set all pointers to
- * NULL.  Does not free the @ref pn_connection_driver_t struct itself.
- */
-PN_EXTERN void pn_connection_driver_destroy(pn_connection_driver_t *);
-
-/**
- * Get the read buffer.
- *
- * Copy data from your input byte 

[44/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

2017-01-10 Thread robbie
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/examples/go/proton/broker.go
--
diff --git a/examples/go/proton/broker.go b/examples/go/proton/broker.go
deleted file mode 100644
index 8f0efda..000
--- a/examples/go/proton/broker.go
+++ /dev/null
@@ -1,331 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you 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.
-*/
-
-//
-// This is a simple AMQP broker implemented using the event-driven proton 
package.
-//
-// It maintains a set of named in-memory queues of messages. Clients can send
-// messages to queues or subscribe to receive messages from them.
-//
-
-// TODO: show how to handle acknowledgedments from receivers and put rejected 
or
-// un-acknowledged messages back on their queues.
-
-package main
-
-import (
-   "../util"
-   "flag"
-   "fmt"
-   "log"
-   "net"
-   "os"
-   "qpid.apache.org/amqp"
-   "qpid.apache.org/proton"
-)
-
-// Usage and command-line flags
-func usage() {
-   fmt.Fprintf(os.Stderr, `
-Usage: %s
-A simple broker-like demo. Queues are created automatically for sender or 
receiver addrsses.
-`, os.Args[0])
-   flag.PrintDefaults()
-}
-
-var addr = flag.String("addr", ":amqp", "Listening address")
-var credit = flag.Int("credit", 100, "Receiver credit window")
-var qsize = flag.Int("qsize", 1000, "Max queue size")
-
-func main() {
-   flag.Usage = usage
-   flag.Parse()
-   b := {util.MakeQueues(*qsize)}
-   if err := b.run(); err != nil {
-   log.Fatal(err)
-   }
-}
-
-// State for the broker
-type broker struct {
-   queues util.Queues
-}
-
-// Listens for connections and starts a proton.Engine for each one.
-func (b *broker) run() error {
-   listener, err := net.Listen("tcp", *addr)
-   if err != nil {
-   return err
-   }
-   defer listener.Close()
-   fmt.Printf("Listening on %s\n", listener.Addr())
-   for {
-   conn, err := listener.Accept()
-   if err != nil {
-   util.Debugf("Accept error: %v", err)
-   continue
-   }
-   adapter := proton.NewMessagingAdapter(newHandler())
-   // We want to accept messages when they are enqueued, not just 
when they
-   // are received, so we turn off auto-accept and prefetch by the 
adapter.
-   adapter.Prefetch = 0
-   adapter.AutoAccept = false
-   engine, err := proton.NewEngine(conn, adapter)
-   if err != nil {
-   util.Debugf("Connection error: %v", err)
-   continue
-   }
-   engine.Server() // Enable server-side protocol negotiation.
-   util.Debugf("Accepted connection %s", engine)
-   go func() { // Start goroutine to run the engine event loop
-   engine.Run()
-   util.Debugf("Closed %s", engine)
-   }()
-   }
-}
-
-// handler handles AMQP events. There is one handler per connection.  The
-// handler does not need to be concurrent-safe as proton.Engine will serialize
-// all calls to the handler. We use channels to communicate between the handler
-// goroutine and other goroutines sending and receiving messages.
-type handler struct {
-   queues*util.Queues
-   receivers map[proton.Link]*receiver
-   senders   map[proton.Link]*sender
-   injecter  proton.Injecter
-}
-
-func newHandler(queues *util.Queues) *handler {
-   return {
-   queues:queues,
-   receivers: make(map[proton.Link]*receiver),
-   senders:   make(map[proton.Link]*sender),
-   }
-}
-
-// HandleMessagingEvent handles an event, called in the handler goroutine.
-func (h *handler) HandleMessagingEvent(t proton.MessagingEvent, e 
proton.Event) {
-   switch t {
-
-   case proton.MStart:
-   h.injecter = e.Injecter()
-
-   case proton.MLinkOpening:
-   if e.Link().IsReceiver() {
-   h.startReceiver(e)
-   } else {
-   h.startSender(e)
-   }
-
-   case proton.MLinkClosed:
-   

svn commit: r1778121 - /qpid/java/trunk/pom.xml

2017-01-10 Thread orudyy
Author: orudyy
Date: Tue Jan 10 13:36:47 2017
New Revision: 1778121

URL: http://svn.apache.org/viewvc?rev=1778121=rev
Log:
NO-JIRA: Turn off maven compiler plugin setting 'useIncrementalCompilation' in 
order to to avoid spurious re-compilation of the generated classes resulted in 
duplicate class errors

Modified:
qpid/java/trunk/pom.xml

Modified: qpid/java/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/qpid/java/trunk/pom.xml?rev=1778121=1778120=1778121=diff
==
--- qpid/java/trunk/pom.xml (original)
+++ qpid/java/trunk/pom.xml Tue Jan 10 13:36:47 2017
@@ -258,6 +258,7 @@
 true
 true
 true
+false
   
 
 



-
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org



svn commit: r1778099 - in /qpid/java/trunk/broker-core/src: main/java/org/apache/qpid/server/model/ test/java/org/apache/qpid/server/model/adapter/ test/java/org/apache/qpid/server/security/

2017-01-10 Thread rgodfrey
Author: rgodfrey
Date: Tue Jan 10 09:29:55 2017
New Revision: 1778099

URL: http://svn.apache.org/viewvc?rev=1778099=rev
Log:
QPID-7612 : Fix mocking and allow parent to be null so that tests pass

Modified:

qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectFactoryImpl.java

qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/adapter/PortFactoryTest.java

qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/security/FileKeyStoreTest.java

qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/security/FileTrustStoreTest.java

Modified: 
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectFactoryImpl.java
URL: 
http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectFactoryImpl.java?rev=1778099=1778098=1778099=diff
==
--- 
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectFactoryImpl.java
 (original)
+++ 
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectFactoryImpl.java
 Tue Jan 10 09:29:55 2017
@@ -111,14 +111,17 @@ public class ConfiguredObjectFactoryImpl
 
 private String getOnlyValidChildTypeIfKnown(final ConfiguredObject 
parent, final String category)
 {
-String foo = null;
-final Collection validChildTypes =
-
_model.getTypeRegistry().getValidChildTypes(parent.getTypeClass(), category);
-if (validChildTypes != null && validChildTypes.size() == 1)
+if(parent != null)
 {
-foo = validChildTypes.iterator().next();
+final Collection validChildTypes =
+
_model.getTypeRegistry().getValidChildTypes(parent.getTypeClass(), category);
+if (validChildTypes != null && validChildTypes.size() == 1)
+{
+return validChildTypes.iterator().next();
+}
 }
-return foo;
+return null;
+
 }
 
 @Override

Modified: 
qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/adapter/PortFactoryTest.java
URL: 
http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/adapter/PortFactoryTest.java?rev=1778099=1778098=1778099=diff
==
--- 
qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/adapter/PortFactoryTest.java
 (original)
+++ 
qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/adapter/PortFactoryTest.java
 Tue Jan 10 09:29:55 2017
@@ -87,6 +87,7 @@ public class PortFactoryTest extends Qpi
 when(_broker.getCategoryClass()).thenReturn(Broker.class);
 when(_broker.getEventLogger()).thenReturn(new EventLogger());
 when(_broker.getParent()).thenReturn(systemConfig);
+when(_broker.getTypeClass()).thenReturn(Broker.class);
 
 ConfiguredObjectFactory objectFactory = new 
ConfiguredObjectFactoryImpl(BrokerModel.getInstance());
 when(_broker.getObjectFactory()).thenReturn(objectFactory);

Modified: 
qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/security/FileKeyStoreTest.java
URL: 
http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/security/FileKeyStoreTest.java?rev=1778099=1778098=1778099=diff
==
--- 
qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/security/FileKeyStoreTest.java
 (original)
+++ 
qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/security/FileKeyStoreTest.java
 Tue Jan 10 09:29:55 2017
@@ -62,6 +62,7 @@ public class FileKeyStoreTest extends Qp
 when(_broker.getModel()).thenReturn(_model);
 when(_broker.getCategoryClass()).thenReturn(Broker.class);
 when(_broker.getEventLogger()).thenReturn(new EventLogger());
+when(_broker.getTypeClass()).thenReturn(Broker.class);
 }
 
 public void testCreateKeyStoreFromFile_Success() throws Exception

Modified: 
qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/security/FileTrustStoreTest.java
URL: 
http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/security/FileTrustStoreTest.java?rev=1778099=1778098=1778099=diff
==
--- 
qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/security/FileTrustStoreTest.java
 (original)
+++ 
qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/security/FileTrustStoreTest.java
 Tue Jan 10 09:29:55 2017
@@ -66,6 +66,7 @@ public class FileTrustStoreTest extends
 when(_broker.getModel()).thenReturn(_model);