From 902ed04d2ffb6a897dd8a395273df1fe6647a407 Mon Sep 17 00:00:00 2001 From: Rajith Muditha Attapattu Date: Thu, 7 Jun 2012 17:34:24 +0000 Subject: QPID-4027 Added JNILayerException to communicate errors occuring in the JNI code. Added Apache License to the files missing the header. Adding the updated qpid_cpp_jni.jar git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/address-refactor2@1347724 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/qpid/messaging/cpp/CppConnection.java | 17 +++++++++++++ .../qpid/messaging/cpp/CppConnectionFactory.java | 5 ++++ .../org/apache/qpid/messaging/cpp/CppReceiver.java | 17 +++++++++++++ .../org/apache/qpid/messaging/cpp/CppSender.java | 17 +++++++++++++ .../org/apache/qpid/messaging/cpp/CppSession.java | 17 +++++++++++++ .../org/apache/qpid/messaging/cpp/CppTest.java | 19 +++++++++++++-- .../qpid/messaging/cpp/JNILayerException.java | 28 ++++++++++++++++++++++ .../org/apache/qpid/messaging/cpp/TextMessage.java | 17 +++++++++++++ 8 files changed, 135 insertions(+), 2 deletions(-) create mode 100644 qpid/java/client-api/src/main/java/org/apache/qpid/messaging/cpp/JNILayerException.java (limited to 'qpid/java/client-api/src') diff --git a/qpid/java/client-api/src/main/java/org/apache/qpid/messaging/cpp/CppConnection.java b/qpid/java/client-api/src/main/java/org/apache/qpid/messaging/cpp/CppConnection.java index a131ebe2fc..7103af1083 100644 --- a/qpid/java/client-api/src/main/java/org/apache/qpid/messaging/cpp/CppConnection.java +++ b/qpid/java/client-api/src/main/java/org/apache/qpid/messaging/cpp/CppConnection.java @@ -1,3 +1,20 @@ +/* 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.messaging.cpp; import org.apache.qpid.messaging.Connection; diff --git a/qpid/java/client-api/src/main/java/org/apache/qpid/messaging/cpp/CppConnectionFactory.java b/qpid/java/client-api/src/main/java/org/apache/qpid/messaging/cpp/CppConnectionFactory.java index 3339c29563..5e606cdc23 100644 --- a/qpid/java/client-api/src/main/java/org/apache/qpid/messaging/cpp/CppConnectionFactory.java +++ b/qpid/java/client-api/src/main/java/org/apache/qpid/messaging/cpp/CppConnectionFactory.java @@ -19,12 +19,17 @@ package org.apache.qpid.messaging.cpp; import org.apache.qpid.messaging.Connection; import org.apache.qpid.messaging.ConnectionFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class CppConnectionFactory extends ConnectionFactory { + private static final Logger _logger = LoggerFactory.getLogger(CppConnectionFactory.class); + static { System.loadLibrary("cqpid_java"); + _logger.info("native qpid library was loaded sucessfully"); } public CppConnectionFactory() diff --git a/qpid/java/client-api/src/main/java/org/apache/qpid/messaging/cpp/CppReceiver.java b/qpid/java/client-api/src/main/java/org/apache/qpid/messaging/cpp/CppReceiver.java index baf3c13e41..102820850f 100644 --- a/qpid/java/client-api/src/main/java/org/apache/qpid/messaging/cpp/CppReceiver.java +++ b/qpid/java/client-api/src/main/java/org/apache/qpid/messaging/cpp/CppReceiver.java @@ -1,3 +1,20 @@ +/* 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.messaging.cpp; import org.apache.qpid.messaging.Message; diff --git a/qpid/java/client-api/src/main/java/org/apache/qpid/messaging/cpp/CppSender.java b/qpid/java/client-api/src/main/java/org/apache/qpid/messaging/cpp/CppSender.java index 54389e8bcd..acbfb8397b 100644 --- a/qpid/java/client-api/src/main/java/org/apache/qpid/messaging/cpp/CppSender.java +++ b/qpid/java/client-api/src/main/java/org/apache/qpid/messaging/cpp/CppSender.java @@ -1,3 +1,20 @@ +/* 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.messaging.cpp; import org.apache.qpid.messaging.Message; diff --git a/qpid/java/client-api/src/main/java/org/apache/qpid/messaging/cpp/CppSession.java b/qpid/java/client-api/src/main/java/org/apache/qpid/messaging/cpp/CppSession.java index fd59aae323..503e07f8c0 100644 --- a/qpid/java/client-api/src/main/java/org/apache/qpid/messaging/cpp/CppSession.java +++ b/qpid/java/client-api/src/main/java/org/apache/qpid/messaging/cpp/CppSession.java @@ -1,3 +1,20 @@ +/* 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.messaging.cpp; import org.apache.qpid.messaging.Address; diff --git a/qpid/java/client-api/src/main/java/org/apache/qpid/messaging/cpp/CppTest.java b/qpid/java/client-api/src/main/java/org/apache/qpid/messaging/cpp/CppTest.java index e74cba908d..c4caf11975 100644 --- a/qpid/java/client-api/src/main/java/org/apache/qpid/messaging/cpp/CppTest.java +++ b/qpid/java/client-api/src/main/java/org/apache/qpid/messaging/cpp/CppTest.java @@ -1,3 +1,20 @@ +/* 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.messaging.cpp; import org.apache.qpid.messaging.Connection; @@ -11,8 +28,6 @@ public class CppTest { public static void main(String[] args) { - System.out.println(System.getProperty("sys.path")); - Connection con = ConnectionFactory.get().createConnection("localhost:5672"); con.open(); Session ssn = con.createSession("hello"); diff --git a/qpid/java/client-api/src/main/java/org/apache/qpid/messaging/cpp/JNILayerException.java b/qpid/java/client-api/src/main/java/org/apache/qpid/messaging/cpp/JNILayerException.java new file mode 100644 index 0000000000..f5a210256c --- /dev/null +++ b/qpid/java/client-api/src/main/java/org/apache/qpid/messaging/cpp/JNILayerException.java @@ -0,0 +1,28 @@ +/* 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.messaging.cpp; + +public class JNILayerException extends RuntimeException +{ + + public JNILayerException(String message) + { + super(message); + } + +} diff --git a/qpid/java/client-api/src/main/java/org/apache/qpid/messaging/cpp/TextMessage.java b/qpid/java/client-api/src/main/java/org/apache/qpid/messaging/cpp/TextMessage.java index 7700f2460e..1a6644b77c 100644 --- a/qpid/java/client-api/src/main/java/org/apache/qpid/messaging/cpp/TextMessage.java +++ b/qpid/java/client-api/src/main/java/org/apache/qpid/messaging/cpp/TextMessage.java @@ -1,3 +1,20 @@ +/* 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.messaging.cpp; import java.util.Map; -- cgit v1.2.1