-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat/SessionReplicationAop #633
Open
mgillian
wants to merge
6
commits into
uPortal-Project:master
Choose a base branch
from
mgillian:feat/SessionReplicationAop
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e97fc9d
feat/SessionReplicationAop
f9c809f
Merge branch 'master' into feat/SessionReplicationAop
mgillian 213231b
feat/SessionReplicationAop refer to correct uPortal version
e7aeb5a
feat/SessionReplicationAop working version, everything located within…
mgillian ff3ca80
feat/SessionReplicationAop relocated property check to tomcatConfig t…
mgillian c136f21
feat/SessionReplicationAop fix bug in aop.gradle
mgillian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# 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. | ||
|
||
handlers = 1catalina.org.apache.juli.AsyncFileHandler, 2localhost.org.apache.juli.AsyncFileHandler, 3manager.org.apache.juli.AsyncFileHandler, 4host-manager.org.apache.juli.AsyncFileHandler, 5aop-serializer.org.apache.juli.AsyncFileHandler, java.util.logging.ConsoleHandler | ||
|
||
.handlers = 1catalina.org.apache.juli.AsyncFileHandler, 5aop-serializer.org.apache.juli.AsyncFileHandler, java.util.logging.ConsoleHandler | ||
|
||
############################################################ | ||
# Handler specific properties. | ||
# Describes specific configuration info for Handlers. | ||
############################################################ | ||
|
||
1catalina.org.apache.juli.AsyncFileHandler.level = FINE | ||
1catalina.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs | ||
1catalina.org.apache.juli.AsyncFileHandler.prefix = catalina. | ||
1catalina.org.apache.juli.AsyncFileHandler.encoding = UTF-8 | ||
|
||
2localhost.org.apache.juli.AsyncFileHandler.level = FINE | ||
2localhost.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs | ||
2localhost.org.apache.juli.AsyncFileHandler.prefix = localhost. | ||
2localhost.org.apache.juli.AsyncFileHandler.encoding = UTF-8 | ||
|
||
3manager.org.apache.juli.AsyncFileHandler.level = FINE | ||
3manager.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs | ||
3manager.org.apache.juli.AsyncFileHandler.prefix = manager. | ||
3manager.org.apache.juli.AsyncFileHandler.encoding = UTF-8 | ||
|
||
4host-manager.org.apache.juli.AsyncFileHandler.level = FINE | ||
4host-manager.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs | ||
4host-manager.org.apache.juli.AsyncFileHandler.prefix = host-manager. | ||
4host-manager.org.apache.juli.AsyncFileHandler.encoding = UTF-8 | ||
|
||
java.util.logging.ConsoleHandler.level = FINE | ||
java.util.logging.ConsoleHandler.formatter = org.apache.juli.OneLineFormatter | ||
java.util.logging.ConsoleHandler.encoding = UTF-8 | ||
|
||
5aop-serializer.org.apache.juli.AsyncFileHandler.level = INFO | ||
5aop-serializer.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs | ||
5aop-serializer.org.apache.juli.AsyncFileHandler.prefix = aop-serializer. | ||
5aop-serializer.org.apache.juli.AsyncFileHandler.encoding = UTF-8 | ||
############################################################ | ||
# Facility specific properties. | ||
# Provides extra control for each logger. | ||
############################################################ | ||
|
||
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO | ||
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers = 2localhost.org.apache.juli.AsyncFileHandler | ||
|
||
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].level = INFO | ||
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].handlers = 3manager.org.apache.juli.AsyncFileHandler | ||
|
||
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].level = INFO | ||
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].handlers = 4host-manager.org.apache.juli.AsyncFileHandler | ||
|
||
org.apereo.portal.[Catalina].[localhost].[/aop-serializer].level = INFO | ||
org.apereo.portal.[Catalina].[localhost].[/aop-serializer].handlers = 5aop-serializer.org.apache.juli.AsyncFileHandler | ||
|
||
# For example, set the org.apache.catalina.util.LifecycleBase logger to log | ||
# each component that extends LifecycleBase changing state: | ||
#org.apache.catalina.util.LifecycleBase.level = FINE | ||
|
||
# To see debug messages in TldLocationsCache, uncomment the following line: | ||
#org.apache.jasper.compiler.TldLocationsCache.level = FINE | ||
|
||
# To see debug messages for HTTP/2 handling, uncomment the following line: | ||
#org.apache.coyote.http2.level = FINE | ||
|
||
# To see debug messages for WebSocket handling, uncomment the following line: | ||
#org.apache.tomcat.websocket.level = FINE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
repositories { | ||
jgribonvald marked this conversation as resolved.
Show resolved
Hide resolved
|
||
mavenLocal() | ||
mavenCentral() | ||
} | ||
|
||
configurations { | ||
tomcat | ||
shared | ||
} | ||
|
||
dependencies { | ||
tomcat "org.apache.tomcat:tomcat:${tomcatVersion}@tar.gz" | ||
shared "javax.ccpp:ccpp:${ccppVersion}" | ||
shared "org.apache.portals.pluto:pluto-container-api:${plutoVersion}" | ||
shared "org.apache.portals.pluto:pluto-container-driver-api:${plutoVersion}" | ||
shared "org.apache.portals.pluto:pluto-taglib:${plutoVersion}" | ||
shared "org.apereo.service.persondir:person-directory-api:${personDirectoryVersion}" | ||
shared "${portletApiDependency}" | ||
} | ||
|
||
/* | ||
* deployAopArchives is a custom task that moves HttpSession instrumented classes and needed | ||
* dependencies to the correct place within ./gradle/tomcat. There are three primary parts: | ||
* 1. Build a jar that contains two cusomt classes, HttpSessionAspect and StandardSessionFacade | ||
* and puts them into the .gradle/tomcat/lib folder in their own jar. HttpSession's implementing class | ||
* must be located in tomcat's lib folder or it won't be found, and the aspect must be with it. | ||
* 2. Put the aspectjweaver.1.9.9.1 jar in the same lib folder | ||
* 3. Update the catalina.jar that also lives in this lib folder by deleting the now duplicated | ||
* StandardSessionFacade. The current implementation creates a duplicate jar with the missing file | ||
* and deletes the original file to prevent conflict. Once this is done, it's hard to recover without | ||
* doing a tomcatInstall, so this may need additinoal work, if this function is run. | ||
* If this function is not run, uPortal on tomcat will run as normal. | ||
*/ | ||
task deployAopArchives() { | ||
dependsOn ':portalProperties' | ||
dependsOn ':buildAopJar' | ||
dependsOn ':buildCatalinaAopJar' | ||
doLast { | ||
String serverHome = rootProject.ext['buildProperties'].getProperty('server.home') | ||
copy { | ||
from "${serverHome}/webapps/uPortal/WEB-INF/lib/aspectjweaver-1.9.9.1.jar" | ||
into "${serverHome}/lib" | ||
} | ||
delete "${serverHome}/lib/catalina.jar" | ||
} | ||
} | ||
|
||
task buildAopJar(type: Zip) { | ||
group 'Tomcat' | ||
description 'Build AOP Archive for HttpSession testing' | ||
|
||
// I'm not sure why, but :portalProperties does not expose server.home | ||
// like it does in other functions. This is directly related to type: Zip | ||
// in the function designation. If the tomcat server is located in another location, | ||
// this property will need to be updated | ||
String serverHome = ".gradle/tomcat" | ||
from("${serverHome}/webapps/uPortal/WEB-INF/classes") { | ||
include("org/apereo/portal/context/HttpSessionAspect.class") | ||
include("org/apache/catalina/session/StandardSessionFacade.class") | ||
} | ||
archiveName 'uPortalAopArchive.jar' | ||
destinationDir(file("${serverHome}/lib")) | ||
} | ||
|
||
task buildCatalinaAopJar(type: Zip) { | ||
group 'Tomcat' | ||
// I'm not sure why, but :portalProperties does not expose server.home | ||
// like it does in other functions. This is directly related to type: Zip | ||
// in the function designation. If the tomcat server is located in another location, | ||
// this property will need to be updated | ||
String serverHome = ".gradle/tomcat" | ||
from zipTree("${serverHome}/lib/catalina.jar").matching { | ||
exclude 'org/apache/catalina/session/StandardSessionFacade.class' | ||
} | ||
archiveName 'catalina-aop.jar' | ||
destinationDir(file("${serverHome}/lib")) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the difference between a
handler
and a.handler
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logging.properties comes directly from apache tomcat (https://tomcat.apache.org/tomcat-8.0-doc/logging.html). I don't understand what each of the configurations are for; I just tried to follow the existing pattern. I saw that the other handlers had entries in both lists, so I added the new one to both lists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This configuration file isn't related to this feature and in my mind shouldn't be on this commit.
Tomcat logging shouldn't be provided in all case because it's a user customisation. In my case I prefer to keep default tomcat logging file.
Your purpose is to provide a rotation on tomcat catalina.out file, this rotation should be done by logrotate (or any other tool) and is an "OS dependancy". Or if you want a such change do a request on tomcat source, you will get their feed back about a such feature/need.