Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Genesys Backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
44
Issues
44
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Genesys PGR
Genesys Backend
Commits
611a9a90
Commit
611a9a90
authored
May 15, 2017
by
Matija Obreza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upgraded springframework and hazelcast (session creation was forced by spring)
parent
bd39b807
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
105 deletions
+7
-105
pom.xml
pom.xml
+3
-8
src/main/java/org/genesys2/spring/config/HazelcastConfig.java
...main/java/org/genesys2/spring/config/HazelcastConfig.java
+1
-1
src/main/java/org/genesys2/spring/config/HazelcastConfigAWS.java
...n/java/org/genesys2/spring/config/HazelcastConfigAWS.java
+0
-94
src/main/java/org/genesys2/spring/config/SpringCacheConfig.java
...in/java/org/genesys2/spring/config/SpringCacheConfig.java
+3
-2
No files found.
pom.xml
View file @
611a9a90
...
...
@@ -71,7 +71,7 @@
<servlet-api.version>
2.5
</servlet-api.version>
<jsp-api.version>
2.1
</jsp-api.version>
<spring.framework.version>
4.
2.5
.RELEASE
</spring.framework.version>
<spring.framework.version>
4.
3.8
.RELEASE
</spring.framework.version>
<spring.data.release-train>
Hopper-SR1
</spring.data.release-train>
<spring.security.version>
4.0.4.RELEASE
</spring.security.version>
<spring.security.oauth2.version>
1.0.5.RELEASE
</spring.security.oauth2.version>
...
...
@@ -88,10 +88,10 @@
<aspectj.version>
1.7.2
</aspectj.version>
<mysql.version>
5.1.31
</mysql.version>
<hazelcast.version>
3.
6.6
</hazelcast.version>
<hazelcast.version>
3.
8.1
</hazelcast.version>
<oval.version>
1.81
</oval.version>
<jackson.version>
2.
2.1
</jackson.version>
<jackson.version>
2.
6.4
</jackson.version>
<jaxb-api.version>
2.2.12
</jaxb-api.version>
<!--Container -->
...
...
@@ -373,11 +373,6 @@
<artifactId>
hazelcast-spring
</artifactId>
<version>
${hazelcast.version}
</version>
</dependency>
<dependency>
<groupId>
com.hazelcast
</groupId>
<artifactId>
hazelcast-cloud
</artifactId>
<version>
${hazelcast.version}
</version>
</dependency>
<dependency>
<groupId>
com.hazelcast
</groupId>
<artifactId>
hazelcast-hibernate4
</artifactId>
...
...
src/main/java/org/genesys2/spring/config/HazelcastConfig.java
View file @
611a9a90
...
...
@@ -40,7 +40,7 @@ import org.springframework.context.annotation.Import;
@Configuration
@EnableCaching
@Import
({
HazelcastConfig
AWS
.
class
,
HazelcastConfig
Cacher
.
class
})
@Import
({
HazelcastConfigCacher
.
class
})
public
abstract
class
HazelcastConfig
{
protected
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
HazelcastConfig
.
class
);
...
...
src/main/java/org/genesys2/spring/config/HazelcastConfigAWS.java
deleted
100644 → 0
View file @
bd39b807
/**
* Copyright 2014 Global Crop Diversity Trust
*
* Licensed 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.genesys2.spring.config
;
import
com.hazelcast.config.AwsConfig
;
import
com.hazelcast.config.Config
;
import
com.hazelcast.config.GroupConfig
;
import
com.hazelcast.config.JoinConfig
;
import
com.hazelcast.config.NetworkConfig
;
import
com.hazelcast.core.Hazelcast
;
import
com.hazelcast.core.HazelcastInstance
;
import
com.hazelcast.core.ManagedContext
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Profile
;
@Configuration
@Profile
(
"aws"
)
public
class
HazelcastConfigAWS
extends
HazelcastConfig
{
@Value
(
"${hazelcast.aws.region}"
)
private
String
region
;
@Value
(
"${hazelcast.aws.access-key}"
)
private
String
accessKey
;
@Value
(
"${hazelcast.aws.secret-key}"
)
private
String
secretKey
;
@Value
(
"${hazelcast.aws.security-group}"
)
private
String
securityGroupName
;
@Bean
public
HazelcastInstance
hazelcast
(
ManagedContext
managedContext
)
{
Config
cfg
=
new
Config
();
cfg
.
setManagedContext
(
managedContext
);
cfg
.
setInstanceName
(
instanceName
);
GroupConfig
groupConfig
=
cfg
.
getGroupConfig
();
groupConfig
.
setName
(
name
);
groupConfig
.
setPassword
(
password
);
cfg
.
setProperty
(
"hazelcast.merge.first.run.delay.seconds"
,
"5"
);
cfg
.
setProperty
(
"hazelcast.merge.next.run.delay.seconds"
,
"5"
);
cfg
.
setProperty
(
"hazelcast.logging.type"
,
"log4j"
);
cfg
.
setProperty
(
"hazelcast.icmp.enabled"
,
"true"
);
NetworkConfig
network
=
cfg
.
getNetworkConfig
();
network
.
setPort
(
hazelPort
);
network
.
setPortAutoIncrement
(
false
);
if
(
StringUtils
.
isNotBlank
(
hazelPublicAddress
))
{
System
.
out
.
println
(
"Hazelcast: Using public address "
+
hazelPublicAddress
);
network
.
setPublicAddress
(
hazelPublicAddress
);
}
if
(
StringUtils
.
isNotBlank
(
hazelInterfaces
))
{
for
(
String
hazelInterface
:
hazelInterfaces
.
split
(
","
))
{
System
.
out
.
println
(
"Hazelcast: Adding single interface "
+
hazelInterface
);
network
.
getInterfaces
().
addInterface
(
hazelInterface
);
}
}
JoinConfig
join
=
network
.
getJoin
();
join
.
getMulticastConfig
().
setEnabled
(
false
);
AwsConfig
awsConfig
=
join
.
getAwsConfig
();
awsConfig
.
setEnabled
(
true
);
awsConfig
.
setRegion
(
region
);
awsConfig
.
setAccessKey
(
accessKey
);
awsConfig
.
setSecretKey
(
secretKey
);
awsConfig
.
setConnectionTimeoutSeconds
(
20
);
awsConfig
.
setSecurityGroupName
(
securityGroupName
);
configureHazelcast
(
cfg
);
HazelcastInstance
instance
=
Hazelcast
.
newHazelcastInstance
(
cfg
);
return
instance
;
}
}
src/main/java/org/genesys2/spring/config/SpringCacheConfig.java
View file @
611a9a90
...
...
@@ -99,13 +99,14 @@ public class SpringCacheConfig {
final
Properties
properties
=
new
Properties
();
properties
.
setProperty
(
"use-client"
,
"false"
);
properties
.
setProperty
(
"map-name"
,
"jetty-sessions"
);
properties
.
setProperty
(
"session-ttl-seconds"
,
"21600"
);
// Not allowed in HZ-3.8.1
// properties.setProperty("session-ttl-seconds", "21600");
properties
.
setProperty
(
"sticky-session"
,
"false"
);
properties
.
setProperty
(
"cookie-name"
,
"hz-session-id"
);
properties
.
setProperty
(
"cookie-domain"
,
cookieDomain
);
properties
.
setProperty
(
"cookie-secure"
,
cookieSecure
);
properties
.
setProperty
(
"cookie-http-only"
,
cookieHttpOnly
);
properties
.
setProperty
(
"debug"
,
"true"
);
//
properties.setProperty("debug", "true");
properties
.
setProperty
(
"instance-name"
,
instanceName
);
properties
.
setProperty
(
"shutdown-on-destroy"
,
"true"
);
return
properties
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment