activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject git commit: Adds some skeleton classes to the API
Date Mon, 21 Oct 2013 20:56:14 GMT
Updated Branches:
  refs/heads/trunk 81e530cb3 -> e97905f90


Adds some skeleton classes to the API

Project: http://git-wip-us.apache.org/repos/asf/activemq-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-cpp/commit/e97905f9
Tree: http://git-wip-us.apache.org/repos/asf/activemq-cpp/tree/e97905f9
Diff: http://git-wip-us.apache.org/repos/asf/activemq-cpp/diff/e97905f9

Branch: refs/heads/trunk
Commit: e97905f908ff05c31485ae2584cde7662f80a2bc
Parents: 81e530c
Author: Timothy Bish <tabish121@gmai.com>
Authored: Mon Oct 21 16:56:10 2013 -0400
Committer: Timothy Bish <tabish121@gmai.com>
Committed: Mon Oct 21 16:56:10 2013 -0400

----------------------------------------------------------------------
 activemq-cpp/src/main/Makefile.am               |  6 ++
 .../src/main/decaf/net/URLConnection.cpp        | 29 ++++++++
 activemq-cpp/src/main/decaf/net/URLConnection.h | 56 +++++++++++++++
 .../src/main/decaf/net/URLStreamHandler.cpp     | 24 +++++++
 .../src/main/decaf/net/URLStreamHandler.h       | 72 ++++++++++++++++++++
 .../main/decaf/net/URLStreamHandlerFactory.cpp  | 26 +++++++
 .../main/decaf/net/URLStreamHandlerFactory.h    | 56 +++++++++++++++
 7 files changed, 269 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/e97905f9/activemq-cpp/src/main/Makefile.am
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/Makefile.am b/activemq-cpp/src/main/Makefile.am
index a391f03..dc13f85 100644
--- a/activemq-cpp/src/main/Makefile.am
+++ b/activemq-cpp/src/main/Makefile.am
@@ -502,8 +502,11 @@ cc_sources = \
     decaf/net/URI.cpp \
     decaf/net/URISyntaxException.cpp \
     decaf/net/URL.cpp \
+    decaf/net/URLConnection.cpp \
     decaf/net/URLDecoder.cpp \
     decaf/net/URLEncoder.cpp \
+    decaf/net/URLStreamHandler.cpp \
+    decaf/net/URLStreamHandlerFactory.cpp \
     decaf/net/UnknownHostException.cpp \
     decaf/net/UnknownServiceException.cpp \
     decaf/net/ssl/SSLContext.cpp \
@@ -1173,8 +1176,11 @@ h_sources = \
     decaf/net/URI.h \
     decaf/net/URISyntaxException.h \
     decaf/net/URL.h \
+    decaf/net/URLConnection.h \
     decaf/net/URLDecoder.h \
     decaf/net/URLEncoder.h \
+    decaf/net/URLStreamHandler.h \
+    decaf/net/URLStreamHandlerFactory.h \
     decaf/net/UnknownHostException.h \
     decaf/net/UnknownServiceException.h \
     decaf/net/ssl/SSLContext.h \

http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/e97905f9/activemq-cpp/src/main/decaf/net/URLConnection.cpp
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/decaf/net/URLConnection.cpp b/activemq-cpp/src/main/decaf/net/URLConnection.cpp
new file mode 100644
index 0000000..6bea771
--- /dev/null
+++ b/activemq-cpp/src/main/decaf/net/URLConnection.cpp
@@ -0,0 +1,29 @@
+/*
+ * 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 <decaf/net/URLConnection.h>
+
+using namespace decaf;
+using namespace decaf::net;
+
+////////////////////////////////////////////////////////////////////////////////
+URLConnection::URLConnection(const URL& url) : url(url) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+URLConnection::~URLConnection() {
+}

http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/e97905f9/activemq-cpp/src/main/decaf/net/URLConnection.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/decaf/net/URLConnection.h b/activemq-cpp/src/main/decaf/net/URLConnection.h
new file mode 100644
index 0000000..b148e81
--- /dev/null
+++ b/activemq-cpp/src/main/decaf/net/URLConnection.h
@@ -0,0 +1,56 @@
+/*
+ * 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.
+ */
+
+#ifndef _DECAF_NET_URLCONNECTION_H_
+#define _DECAF_NET_URLCONNECTION_H_
+
+#include <decaf/util/Config.h>
+
+#include <decaf/net/URL.h>
+
+namespace decaf {
+namespace net {
+
+    /**
+     * Concrete implementations of the abstract {@code URLConnection} class provide
+     * a communication link to a URL for exchanging data with a specific protocol
+     * type. A {@code URLConnection} can only be set up after the instantiation but
+     * before connecting to the remote resource.
+     *
+     * @since 1.0
+     */
+    class DECAF_API URLConnection {
+    protected:
+
+        URL url;
+
+    private:
+
+        URLConnection(const URLConnection&);
+        URLConnection& operator= (const URLConnection&);
+
+    public:
+
+        URLConnection(const URL& url);
+
+        virtual ~URLConnection();
+
+    };
+
+}}
+
+#endif /* _DECAF_NET_URLCONNECTION_H_ */

http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/e97905f9/activemq-cpp/src/main/decaf/net/URLStreamHandler.cpp
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/decaf/net/URLStreamHandler.cpp b/activemq-cpp/src/main/decaf/net/URLStreamHandler.cpp
new file mode 100644
index 0000000..013aabc
--- /dev/null
+++ b/activemq-cpp/src/main/decaf/net/URLStreamHandler.cpp
@@ -0,0 +1,24 @@
+/*
+ * 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 <decaf/net/URLStreamHandler.h>
+
+using namespace decaf;
+using namespace decaf::net;
+
+////////////////////////////////////////////////////////////////////////////////
+URLStreamHandler::~URLStreamHandler() {}

http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/e97905f9/activemq-cpp/src/main/decaf/net/URLStreamHandler.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/decaf/net/URLStreamHandler.h b/activemq-cpp/src/main/decaf/net/URLStreamHandler.h
new file mode 100644
index 0000000..46914b1
--- /dev/null
+++ b/activemq-cpp/src/main/decaf/net/URLStreamHandler.h
@@ -0,0 +1,72 @@
+/*
+ * 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.
+ */
+
+#ifndef _DECAF_NET_URLSTREAMHANDLER_H_
+#define _DECAF_NET_URLSTREAMHANDLER_H_
+
+#include <decaf/util/Config.h>
+
+#include <decaf/net/URL.h>
+
+namespace decaf {
+namespace net {
+
+    class URLConnection;
+
+    /**
+     * The abstract class URLStreamHandler is the common superclass for all stream protocol
+     * handlers. A stream protocol handler knows how to make a connection for a particular
+     * protocol type, such as http, ftp, or https etc.
+     *
+     * In most cases, an instance of a URLStreamHandler subclass is not created directly
by
+     * an application. Rather, the first time a protocol name is encountered when constructing
+     * a URL, the appropriate stream protocol handler is automatically created from a registered
+     * stream handler factory.
+     *
+     * @since 1.0
+     */
+    class DECAF_API URLStreamHandler {
+    private:
+
+        URLStreamHandler(const URLStreamHandler&);
+        URLStreamHandler& operator= (const URLStreamHandler&);
+
+    public:
+
+        virtual ~URLStreamHandler();
+
+    protected:
+
+        /**
+         * Establishes a new connection to the resource specified by the given URL.
+         * Since different protocols also have unique ways of connecting, it must be
+         * overridden by the subclass.
+         *
+         * @param url
+         *      the URL to the resource where a connection has to be opened.
+         *
+         * @return pointer to the opened URLConnection to the specified resource.
+         *
+         * @throws IOException if an I/O error occurs during opening the connection.
+         */
+        virtual URLConnection* openConnection(const URL& url) = 0;
+
+    };
+
+}}
+
+#endif /* _DECAF_NET_URLSTREAMHANDLER_H_ */

http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/e97905f9/activemq-cpp/src/main/decaf/net/URLStreamHandlerFactory.cpp
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/decaf/net/URLStreamHandlerFactory.cpp b/activemq-cpp/src/main/decaf/net/URLStreamHandlerFactory.cpp
new file mode 100644
index 0000000..f4f4c46
--- /dev/null
+++ b/activemq-cpp/src/main/decaf/net/URLStreamHandlerFactory.cpp
@@ -0,0 +1,26 @@
+/*
+ * 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 <decaf/net/URLStreamHandlerFactory.h>
+
+using namespace decaf;
+using namespace decaf::net;
+
+////////////////////////////////////////////////////////////////////////////////
+URLStreamHandlerFactory::~URLStreamHandlerFactory() {
+}
+

http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/e97905f9/activemq-cpp/src/main/decaf/net/URLStreamHandlerFactory.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/decaf/net/URLStreamHandlerFactory.h b/activemq-cpp/src/main/decaf/net/URLStreamHandlerFactory.h
new file mode 100644
index 0000000..c44ad2e
--- /dev/null
+++ b/activemq-cpp/src/main/decaf/net/URLStreamHandlerFactory.h
@@ -0,0 +1,56 @@
+/*
+ * 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.
+ */
+
+#ifndef _DECAF_NET_URLSTREAMHANDLERFACTORY_H_
+#define _DECAF_NET_URLSTREAMHANDLERFACTORY_H_
+
+#include <decaf/util/Config.h>
+
+#include <string>
+
+namespace decaf {
+namespace net {
+
+    class URLStreamHandler;
+
+    /**
+     * Defines a factory which creates an URLStreamHandler for a specified
+     * protocol. It is used by the class URL.
+     *
+     * @since 1.0
+     */
+    class URLStreamHandlerFactory {
+    public:
+
+        virtual ~URLStreamHandlerFactory();
+
+        /**
+         * Creates a new {@code URLStreamHandler} instance for the given {@code
+         * protocol}.
+         *
+         * @param protocol
+         *      the protocol for which a handler is needed.
+         *
+         * @return pointer to the created handler.
+         */
+        virtual URLStreamHandler createURLStreamHandler(const std::string& protocol)
= 0;
+
+    };
+
+}}
+
+#endif /* _DECAF_NET_URLSTREAMHANDLERFACTORY_H_ */


Mime
View raw message