rjack-httpclient-3 3.1.4-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/History.rdoc ADDED
@@ -0,0 +1,15 @@
1
+ === 3.1.4 (2010-3-6)
2
+ * Set gem platform to java
3
+ * Upgraded to tarpit ~> 1.2.0
4
+
5
+ === 3.1.3 (2009-10-10)
6
+ * Rename gem rjack-httpclient-3 and as module RJack::HTTPClient3
7
+ * Update/relax rjack-slf4j dependency to '~> 1.5.8' (tested with slf4j 1.5.8.1).
8
+ * Replace included commons-codec with rjack-commons-codec gem dependency.
9
+ * Use rjack-tarpit for build.
10
+
11
+ === 3.1.2 (2009-5-29)
12
+ * Use rdoc 2.4.3 and hoe 1.12.2 for build.
13
+
14
+ === 3.1.1 (2009-2-22)
15
+ * Inital release based on HttpClient 3.1
data/Manifest.static ADDED
@@ -0,0 +1,11 @@
1
+ Manifest.static
2
+ Manifest.txt
3
+ README.rdoc
4
+ History.rdoc
5
+ NOTICE.txt
6
+ Rakefile
7
+ pom.xml
8
+ assembly.xml
9
+ lib/rjack-httpclient-3/base.rb
10
+ lib/rjack-httpclient-3.rb
11
+ test/test_httpclient.rb
data/Manifest.txt ADDED
@@ -0,0 +1,12 @@
1
+ Manifest.static
2
+ Manifest.txt
3
+ README.rdoc
4
+ History.rdoc
5
+ NOTICE.txt
6
+ Rakefile
7
+ pom.xml
8
+ assembly.xml
9
+ lib/rjack-httpclient-3/base.rb
10
+ lib/rjack-httpclient-3.rb
11
+ test/test_httpclient.rb
12
+ lib/rjack-httpclient-3/commons-httpclient-3.1.jar
data/NOTICE.txt ADDED
@@ -0,0 +1,7 @@
1
+ rjack-httpclient-3 gem
2
+ Copyright (c) 2008-2009 David Kellum
3
+
4
+ This product includes software developed by:
5
+
6
+ Apache HttpComponents Commons HttpClient
7
+ Copyright (c) 1999-2008 The Apache Software Foundation (http://www.apache.org/)
data/README.rdoc ADDED
@@ -0,0 +1,78 @@
1
+ = rjack-httpclient-3
2
+
3
+ * http://rjack.rubyforge.org
4
+ * http://rubyforge.org/projects/rjack
5
+
6
+ == Description
7
+
8
+ A gem packaging of
9
+ {Commons HttpClient 3.x}[http://hc.apache.org/httpclient-3.x] for JRuby.
10
+
11
+ * Provides commons-httpclient jar.
12
+ * Provides a RJack::HTTPClient3::ManagerFacade for client and connection
13
+ manager setup, start, shutdown.
14
+
15
+ == Synopsis
16
+
17
+ require 'rjack-logback'
18
+ require 'rjack-httpclient-3'
19
+
20
+ mf = RJack::HTTPClient3::ManagerFacade.new
21
+
22
+ mf.manager_params.max_total_connections = 200
23
+ mf.client_params.so_timeout = 3000 #ms
24
+ mf.start
25
+
26
+ mf.client # --> org.apache.commons.HttpClient
27
+
28
+ mf.shutdown
29
+
30
+ See {org.apache.commons.HttpClient}[http://hc.apache.org/httpclient-3.x/apidocs/org/apache/commons/httpclient/HttpClient.html].
31
+
32
+ == Requirements
33
+
34
+ * rjack-commons-codec[http://rjack.rubyforge.org/commons-codec].
35
+
36
+ * rjack-slf4j[http://rjack.rubyforge.org/slf4j].
37
+
38
+ * An SLF4J output adaptor such as 'rjack-slf4j/simple' or
39
+ rjack-logback[http://rjack.rubyforge.org/logback] must be require'd
40
+ before rjack-httpclient. (The rjack-logback gem is listed as a
41
+ development dependency only.)
42
+
43
+ == License
44
+
45
+ === rjack-httpclient-3 gem
46
+
47
+ Copyright (c) 2008-2009 David Kellum
48
+
49
+ Licensed under the Apache License, Version 2.0 (the "License"); you
50
+ may not use this file except in compliance with the License. You
51
+ may obtain a copy of the License at:
52
+
53
+ http://www.apache.org/licenses/LICENSE-2.0
54
+
55
+ Unless required by applicable law or agreed to in writing, software
56
+ distributed under the License is distributed on an "AS IS" BASIS,
57
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
58
+ implied. See the License for the specific language governing
59
+ permissions and limitations under the License.
60
+
61
+ === Jakarta Commons HTTPClient (java)
62
+
63
+ Copyright (c) 1999-2008 The Apache Software Foundation
64
+
65
+ Licensed to the Apache Software Foundation (ASF) under one or more
66
+ contributor license agreements. See the NOTICE file distributed with
67
+ this work for additional information regarding copyright ownership.
68
+ The ASF licenses this file to You under the Apache License, Version
69
+ 2.0 (the "License"); you may not use this file except in compliance
70
+ with the License. You may obtain a copy of the License at
71
+
72
+ http://www.apache.org/licenses/LICENSE-2.0
73
+
74
+ Unless required by applicable law or agreed to in writing, software
75
+ distributed under the License is distributed on an "AS IS" BASIS,
76
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
77
+ implied. See the License for the specific language governing
78
+ permissions and limitations under the License.
data/Rakefile ADDED
@@ -0,0 +1,59 @@
1
+ # -*- ruby -*-
2
+ #--
3
+ # Copyright (C) 2008-2009 David Kellum
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License"); you
6
+ # may not use this file except in compliance with the License. You
7
+ # may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
14
+ # implied. See the License for the specific language governing
15
+ # permissions and limitations under the License.
16
+ #++
17
+
18
+ $LOAD_PATH << './lib'
19
+ require 'rjack-httpclient-3/base'
20
+
21
+ require 'rubygems'
22
+ gem 'rjack-tarpit', '~> 1.2.0'
23
+ require 'rjack-tarpit'
24
+
25
+ include RJack
26
+
27
+ t = TarPit.new( 'rjack-httpclient-3', HTTPClient3::VERSION, :java_platform )
28
+
29
+ t.specify do |h|
30
+ h.developer( "David Kellum", "dek-oss@gravitext.com" )
31
+ h.extra_deps += [ [ 'rjack-slf4j', '~> 1.5.8' ],
32
+ [ 'rjack-commons-codec', '~> 1.4.0' ] ]
33
+ h.extra_dev_deps << [ 'rjack-logback', '>= 0.9.17' ]
34
+ h.rubyforge_name = "rjack"
35
+ h.remote_rdoc_dir = "httpclient-3"
36
+ end
37
+
38
+ t.jars = [ "commons-httpclient-#{ HTTPClient3::HTTPCLIENT_VERSION }.jar" ]
39
+
40
+ t.assembly_version = 1.0
41
+
42
+ file 'Manifest.txt' => [ "lib/#{t.name}/base.rb" ]
43
+
44
+ task :check_pom_deps do
45
+ t.test_line_match( 'pom.xml',
46
+ %r[<version>#{ HTTPClient3::HTTPCLIENT_VERSION }</version>] )
47
+ end
48
+ task :check_history_version do
49
+ t.test_line_match( 'History.rdoc', /^==/, / #{t.version} / )
50
+ end
51
+ task :check_history_date do
52
+ t.test_line_match( 'History.rdoc', /^==/, /\([0-9\-]+\)$/ )
53
+ end
54
+
55
+ task :gem => [ :check_pom_deps, :check_history_version ]
56
+ task :tag => [ :check_pom_deps, :check_history_version, :check_history_date ]
57
+ task :push => [ :check_history_date ]
58
+
59
+ t.define_tasks
data/assembly.xml ADDED
@@ -0,0 +1,14 @@
1
+ <assembly>
2
+ <id>bin</id>
3
+ <formats>
4
+ <format>dir</format>
5
+ </formats>
6
+ <includeBaseDirectory>false</includeBaseDirectory>
7
+ <dependencySets>
8
+ <dependencySet>
9
+ <includes>
10
+ <include>commons-httpclient:commons-httpclient</include>
11
+ </includes>
12
+ </dependencySet>
13
+ </dependencySets>
14
+ </assembly>
@@ -0,0 +1,90 @@
1
+ #--
2
+ # Copyright (C) 2008-2009 David Kellum
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License"); you
5
+ # may not use this file except in compliance with the License. You
6
+ # may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13
+ # implied. See the License for the specific language governing
14
+ # permissions and limitations under the License.
15
+ #++
16
+
17
+ require 'rubygems'
18
+
19
+ require 'rjack-slf4j'
20
+ require 'rjack-slf4j/jcl-over-slf4j'
21
+ require 'rjack-commons-codec'
22
+ require 'rjack-httpclient-3/base'
23
+
24
+ module RJack
25
+ module HTTPClient3
26
+
27
+ require "#{HTTPCLIENT_DIR}/commons-httpclient-#{HTTPCLIENT_VERSION}.jar"
28
+
29
+ import 'org.apache.commons.httpclient.params.HttpConnectionManagerParams'
30
+ import 'org.apache.commons.httpclient.params.HttpClientParams'
31
+ import 'org.apache.commons.httpclient.params.HttpMethodParams'
32
+ import 'org.apache.commons.httpclient.DefaultHttpMethodRetryHandler'
33
+ import 'org.apache.commons.httpclient.MultiThreadedHttpConnectionManager'
34
+ import 'org.apache.commons.httpclient.HttpClient'
35
+
36
+ # Facade over http client and connection manager, setup, start, shutdown
37
+ #
38
+ # == Example Settings
39
+ #
40
+ # See: http://hc.apache.org/httpclient-3.x/preference-api.html
41
+ #
42
+ # manager_params.max_total_connections = 200
43
+ # manager_params.connection_timeout = 1500 #ms
44
+ # manager_params.default_max_connections_per_host = 20
45
+ # manager_params.stale_checking_enabled = false
46
+ # client_params.connection_manager_timeout = 3000 #ms
47
+ # client_params.so_timeout = 3000 #ms
48
+ # client_params.set_parameter( HttpMethodParams::RETRY_HANDLER,
49
+ # DefaultHttpMethodRetryHandler.new( 2, false ) )
50
+ # client_params.cookie_policy = CookiePolicy::IGNORE_COOKIES
51
+ #
52
+ # Expect incompatible changes to these setting upon upgrade to 4.0
53
+ class ManagerFacade
54
+
55
+ # The HttpClient instance available after start
56
+ attr_reader :client
57
+
58
+ # Manager parameters
59
+ attr_reader :manager_params
60
+
61
+ # Client parameters
62
+ attr_reader :client_params
63
+
64
+ def initialize
65
+ @manager_params = HttpConnectionManagerParams.new
66
+
67
+ @client_params = HttpClientParams.new
68
+
69
+ @client = nil
70
+ @connection_manager = nil
71
+ end
72
+
73
+ # Given previously set parameters, construct connection manager
74
+ # and client.
75
+ def start
76
+ @connection_manager = MultiThreadedHttpConnectionManager.new()
77
+ @connection_manager.params = @manager_params
78
+
79
+ @client = HttpClient.new( @client_params, @connection_manager );
80
+ end
81
+
82
+ # Shutdown and close the connection manager and client.
83
+ def shutdown
84
+ @connection_manager.shutdown if @connection_manager
85
+ @client = nil
86
+ @connection_manager = nil
87
+ end
88
+ end
89
+ end
90
+ end
@@ -0,0 +1,24 @@
1
+ #--
2
+ # Copyright (C) 2008-2009 David Kellum
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License"); you
5
+ # may not use this file except in compliance with the License. You
6
+ # may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13
+ # implied. See the License for the specific language governing
14
+ # permissions and limitations under the License.
15
+ #++
16
+
17
+ module RJack
18
+ module HTTPClient3
19
+ HTTPCLIENT_VERSION = '3.1'
20
+ VERSION = HTTPCLIENT_VERSION + '.4'
21
+
22
+ HTTPCLIENT_DIR = File.dirname( __FILE__ ) # :nodoc:
23
+ end
24
+ end
data/pom.xml ADDED
@@ -0,0 +1,61 @@
1
+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
2
+
3
+ <modelVersion>4.0.0</modelVersion>
4
+ <groupId>rjack</groupId>
5
+ <artifactId>rjack-httpclient-3</artifactId>
6
+ <packaging>pom</packaging>
7
+ <version>1.0</version>
8
+ <name>HTTPClient Assembly for Gem</name>
9
+
10
+ <dependencies>
11
+
12
+ <dependency>
13
+ <groupId>commons-httpclient</groupId>
14
+ <artifactId>commons-httpclient</artifactId>
15
+ <version>3.1</version>
16
+ <exclusions>
17
+ <exclusion>
18
+ <groupId>commons-logging</groupId>
19
+ <artifactId>commons-logging</artifactId>
20
+ </exclusion>
21
+ </exclusions>
22
+ </dependency>
23
+
24
+ </dependencies>
25
+
26
+ <build>
27
+ <plugins>
28
+ <plugin>
29
+ <artifactId>maven-assembly-plugin</artifactId>
30
+ <configuration>
31
+ <descriptors>
32
+ <descriptor>assembly.xml</descriptor>
33
+ </descriptors>
34
+ <tarLongFileMode>gnu</tarLongFileMode>
35
+ </configuration>
36
+ <executions>
37
+ <execution>
38
+ <id>assembly</id>
39
+ <phase>package</phase>
40
+ <goals>
41
+ <goal>attached</goal>
42
+ </goals>
43
+ </execution>
44
+ </executions>
45
+ </plugin>
46
+ <plugin>
47
+ <artifactId>maven-compiler-plugin</artifactId>
48
+ <configuration>
49
+ <source>1.5</source>
50
+ <target>1.5</target>
51
+ <optimize>true</optimize>
52
+ <debug>true</debug>
53
+ <encoding>UTF-8</encoding>
54
+ <showDeprecation>true</showDeprecation>
55
+ <showWarnings>true</showWarnings>
56
+ </configuration>
57
+ </plugin>
58
+ </plugins>
59
+ </build>
60
+
61
+ </project>
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env jruby
2
+ #--
3
+ # Copyright (C) 2008-2009 David Kellum
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License"); you
6
+ # may not use this file except in compliance with the License. You
7
+ # may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
14
+ # implied. See the License for the specific language governing
15
+ # permissions and limitations under the License.
16
+ #++
17
+
18
+ require 'rubygems'
19
+ gem( 'rjack-logback', '>= 0.9.17.1' )
20
+
21
+ require 'rjack-logback'
22
+ Logback.config_console( :level => Logback::DEBUG )
23
+
24
+ require 'test/unit'
25
+
26
+ $LOAD_PATH.unshift File.join( File.dirname(__FILE__), "..", "lib" )
27
+
28
+ require 'rjack-httpclient-3'
29
+
30
+ class TestClient < Test::Unit::TestCase
31
+ include RJack::HTTPClient3
32
+ def test_setup
33
+ m = ManagerFacade.new
34
+ m.manager_params.max_total_connections = 200
35
+ m.client_params.so_timeout = 3000 #ms
36
+ m.start
37
+
38
+ assert_not_nil m.client
39
+
40
+ m.shutdown
41
+
42
+ assert_nil m.client
43
+ end
44
+ end
metadata ADDED
@@ -0,0 +1,116 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rjack-httpclient-3
3
+ version: !ruby/object:Gem::Version
4
+ version: 3.1.4
5
+ platform: java
6
+ authors:
7
+ - David Kellum
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2010-03-06 00:00:00 -08:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rjack-slf4j
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ~>
22
+ - !ruby/object:Gem::Version
23
+ version: 1.5.8
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: rjack-commons-codec
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: 1.4.0
34
+ version:
35
+ - !ruby/object:Gem::Dependency
36
+ name: rjack-logback
37
+ type: :development
38
+ version_requirement:
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: 0.9.17
44
+ version:
45
+ - !ruby/object:Gem::Dependency
46
+ name: rjack-tarpit
47
+ type: :development
48
+ version_requirement:
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ~>
52
+ - !ruby/object:Gem::Version
53
+ version: 1.2.0
54
+ version:
55
+ description: |-
56
+ A gem packaging of
57
+ {Commons HttpClient 3.x}[http://hc.apache.org/httpclient-3.x] for JRuby.
58
+
59
+ * Provides commons-httpclient jar.
60
+ * Provides a RJack::HTTPClient3::ManagerFacade for client and connection
61
+ manager setup, start, shutdown.
62
+ email:
63
+ - dek-oss@gravitext.com
64
+ executables: []
65
+
66
+ extensions: []
67
+
68
+ extra_rdoc_files:
69
+ - Manifest.txt
70
+ - NOTICE.txt
71
+ - README.rdoc
72
+ - History.rdoc
73
+ files:
74
+ - Manifest.static
75
+ - Manifest.txt
76
+ - README.rdoc
77
+ - History.rdoc
78
+ - NOTICE.txt
79
+ - Rakefile
80
+ - pom.xml
81
+ - assembly.xml
82
+ - lib/rjack-httpclient-3/base.rb
83
+ - lib/rjack-httpclient-3.rb
84
+ - test/test_httpclient.rb
85
+ - lib/rjack-httpclient-3/commons-httpclient-3.1.jar
86
+ has_rdoc: true
87
+ homepage: http://rjack.rubyforge.org
88
+ licenses: []
89
+
90
+ post_install_message:
91
+ rdoc_options:
92
+ - --main
93
+ - README.rdoc
94
+ require_paths:
95
+ - lib
96
+ required_ruby_version: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ version: "0"
101
+ version:
102
+ required_rubygems_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: "0"
107
+ version:
108
+ requirements: []
109
+
110
+ rubyforge_project: rjack
111
+ rubygems_version: 1.3.5
112
+ signing_key:
113
+ specification_version: 3
114
+ summary: A gem packaging of {Commons HttpClient 3.x}[http://hc.apache.org/httpclient-3.x] for JRuby
115
+ test_files:
116
+ - test/test_httpclient.rb