Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
prisma-wildfly
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Descartes Research
prisma-wildfly
Commits
3c4bbeca
Commit
3c4bbeca
authored
8 years ago
by
Simon Spinner
Browse files
Options
Downloads
Patches
Plain Diff
Add WebServiceOutgoingCallInterceptor.
parent
20cb79d4
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools.descartes.prisma.agent.wildfly/src/main/java/tools/descartes/prisma/agent/wildfly/interceptors/WebServiceOutgoingCallInterceptor.java
+74
-0
74 additions, 0 deletions
...ldfly/interceptors/WebServiceOutgoingCallInterceptor.java
with
74 additions
and
0 deletions
tools.descartes.prisma.agent.wildfly/src/main/java/tools/descartes/prisma/agent/wildfly/interceptors/WebServiceOutgoingCallInterceptor.java
0 → 100644
+
74
−
0
View file @
3c4bbeca
/**
* ==============================================
* LibReDE : Library for Resource Demand Estimation
* ==============================================
*
* (c) Copyright 2013-2014, by Simon Spinner and Contributors.
*
* Project Info: http://www.descartes-research.net/
*
* All rights reserved. This software is made available under the terms of the
* Eclipse Public License (EPL) v1.0 as published by the Eclipse Foundation
* http://www.eclipse.org/legal/epl-v10.html
*
* This software is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the Eclipse Public License (EPL)
* for more details.
*
* You should have received a copy of the Eclipse Public License (EPL)
* along with this software; if not visit http://www.eclipse.org or write to
* Eclipse Foundation, Inc., 308 SW First Avenue, Suite 110, Portland, 97204 USA
* Email: license (at) eclipse.org
*
* [Java is a trademark or registered trademark of Sun Microsystems, Inc.
* in the United States and other countries.]
*/
package
tools.descartes.prisma.agent.wildfly.interceptors
;
import
java.lang.reflect.Method
;
import
java.net.MalformedURLException
;
import
java.net.URL
;
import
java.util.Deque
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.xml.namespace.QName
;
import
javax.xml.ws.handler.MessageContext
;
import
org.jboss.logging.Logger
;
import
org.jboss.ws.api.handler.GenericSOAPHandler
;
import
tools.descartes.prisma.agent.wildfly.callstack.ComponentRecord
;
import
tools.descartes.prisma.agent.wildfly.callstack.InvocationRecord
;
import
tools.descartes.prisma.agent.wildfly.callstack.OperationRecord
;
import
tools.descartes.prisma.agent.wildfly.service.MonitoringService
;
/**
* @author Simon Spinner (simon.spinner@uni-wuerzburg.de)
*
*/
public
class
WebServiceOutgoingCallInterceptor
extends
GenericSOAPHandler
{
protected
final
Logger
log
=
Logger
.
getLogger
(
this
.
getClass
());
@Override
protected
boolean
handleOutbound
(
MessageContext
msgContext
)
{
Deque
<
InvocationRecord
>
threadCallStack
=
MonitoringService
.
INSTANCE
.
getCallStack
();
InvocationRecord
currentInvocation
=
threadCallStack
.
peek
();
if
(
currentInvocation
!=
null
)
{
URL
url
;
try
{
url
=
new
URL
((
String
)
msgContext
.
get
(
"javax.xml.ws.service.endpoint.address"
));
Method
caller
=
(
Method
)
msgContext
.
get
(
"java.lang.reflect.Method"
);
ComponentRecord
component
=
MonitoringService
.
INSTANCE
.
requireComponent
(
url
.
getHost
(),
""
,
""
,
url
.
getPath
());
OperationRecord
currentOperation
=
currentInvocation
.
requireEndpoint
(
component
,
caller
.
getDeclaringClass
().
getName
(),
"http"
,
caller
.
getName
());
// TODO: We currently support only one-way messages. Inbound messages are ignored.
InvocationRecord
outgoingInvocation
=
currentOperation
.
startInvocation
();
outgoingInvocation
.
finishInvocation
(
0
,
0
,
0
);
}
catch
(
MalformedURLException
e
)
{
log
.
error
(
"Error reading message data."
,
e
);
}
}
return
true
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment