Notification of shutdown commencing
by Brian Stansberry
I can't figure out a way to produce a notification of an impending
server shutdown if a user does a soft kill of the server process.
It's easy enough if shutdown is initiated by a management op; the op
handler can trigger the notification. But a soft kill triggers a
shutdown hook registered by the MSC ServiceContainer, and once that
starts, services start stopping semi-randomly and its too late to notify
anyone that that is going to start happening.
The MSC shutdown stuff isn't exposed, so there's no way to tie into
that. Adding another shutdown hook doesn't help as there's no
predictable order of execution.
--
Brian Stansberry
Principal Software Engineer
JBoss by Red Hat
11 years, 5 months
Graceful Shutdown (Revision 2)
by Jason T. Greene
*EDITED*
We've worked out the rough outline of how graceful shutdown will work in
AS7.
The process of graceful shutdown actually is reflected by a number of
states:
1. Running - all services acting normally
2. Suspending - services refuse new "permits" (see below), existing
permits are allowed to be retained (and threads running under such a
permit may still acquire new permits)
3. Suspended - no permits are present and none may be issued
4. Shutting Down - our existing server stop process / reload admin mode
The following transitions are allowed:
1. Running → Suspending: Transition occurs at user request (to suspend
or gracefully shut down).
2. Suspending → Suspended: Transition occurs when all permits are cleared.
3. Suspending → Running: Transition occurs at user request (to exit
suspend mode or cancel graceful shutdown before it completes).
4. Suspended → Running: Transition occurs at user request (to exit
suspend mode).
5. Suspended → Shutting Down: Transition occurs automatically (if a
graceful shutdown was requested) or at user request (if a shut down
request of any kind is entered in the Suspended state).
6. Running → Shutting Down: Transition occurs at user request (to shut
down the server "un-gracefully").
7. Suspending → Shutting Down (User aborts a graceful shutdown)
These "permits" are issued by the "Shutdown Manager", whose job is to
manage these states. They are issued corresponding to the following events:
1. The invocation of an EJB method
2. The creation of a web session
3. A creation of a transaction
4. MessageEndpoint and WorkManager aquire permit allowing for release()
from a thirdparty to indicate connection close.
When a permit cannot be issued due to the server shutting down, a
standard exception message should be produced so that the user can see a
familiar error message regardless of what mechanism is used to access
the server.
--
- DML
_______________________________________________
jboss-as7-dev mailing list
jboss-as7-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
12 years
Pull Request Retesting Ability
by Jason T. Greene
FYI,
If you submit a pull request and the test fails due to a possible
intermittent failure or some environmental problem (github was down or
something), instead of rebasing your patch to force a retest, you can
now just ask with a phrase that has "retest this please":
Could you retest this please?
jboss-as-pull-request, you are awesome, now go retest this please!
etc
--
Jason T. Greene
JBoss AS Lead / EAP Platform Architect
JBoss, a division of Red Hat
12 years, 1 month
SIP subsystem - How to map JNDI resources
by JMRecio
Hello, experts,
I started porting Mobicents SIP Servlets framework to AS7, as a
subsystem build on top of on top of 7.1.1.Final, taking advantage of the
WebContextFactory extension.
Port is quite functional already, but I am stuck at one point: sip
servlets do not have access to java:com and java:app JDNI tree, lookup
fails with javax.naming.NameNotFoundException. @Resource mappings work
ok though. HTTP Servlets and EJB can access ok to those parts of the
JNDI tree.
Any hint on where/how JNDI access is setup for HTTP servlets
deployments? I can take it from there.
More details below, including pointers to the soure and a test project
that shows the behaviour on top of the AS7 release.
Any help is much appreciated.
JM
---
Additional details:
- sip subsystem deployer code:
http://code.google.com/p/sipservlets/source/browse/containers/sip-servlet...
- test project showcasing the problem in
http://github.com/josemrecio/test5-as7-sip
build with mvn clean install and deploy on the pre-packaged Mobicents
AS7 release
start AS7 as:
$ bin/standalone.sh -c standalone-sip.xml
-Djavax.servlet.sip.dar=file:///dev/null
- Mobicents AS7 release:
http://sourceforge.net/projects/mobicents/files/Mobicents%20Sip%20Servlet...
- JNDI dump from a SIP Servlet and a HTTP Servlet in the same war and
ear component follows.
Note that HTTP Servlet has access to the full JNDI tree, but SIP Servlet
can't access java:comp or java:app
Dump Jndi view for SIP Servlet:
/ context:
\__com.arjuna.ats.jbossatx.jta.TransactionManagerDelegate TransactionManager
java: context:
\__com.arjuna.ats.jbossatx.jta.TransactionManagerDelegate TransactionManager
javax.naming.NameNotFoundException: java:app
java:global context:
test5-as7-sip-ear
test5-as7-sip-ejb
\__com.chema.ejb.PocheteEjbLocal$$$view18 TheEjb
\__com.chema.ejb.PocheteEjbLocal$$$view18
TheEjb!com.chema.ejb.PocheteEjbLocal
javax.naming.NameNotFoundException: java:comp
Done...
Dump Jndi view for HTTP Servlet:
/ context:
\__com.arjuna.ats.jbossatx.jta.TransactionManagerDelegate TransactionManager
java: context:
\__com.arjuna.ats.jbossatx.jta.TransactionManagerDelegate TransactionManager
java:app context:
\__java.lang.String AppName
\__org.jboss.as.naming.NamingContext env
sip
test5
\__org.mobicents.servlet.sip.message.SipFactoryFacade SipFactory
\__org.mobicents.servlet.sip.core.session.SipSessionsUtilImpl
SipSessionsUtil
\__org.mobicents.servlet.sip.core.timers.TimerServiceImpl TimerService
test5-as7-sip-ejb
\__com.chema.ejb.PocheteEjbLocal$$$view6 TheEjb
\__com.chema.ejb.PocheteEjbLocal$$$view6
TheEjb!com.chema.ejb.PocheteEjbLocal
java:global context:
test5-as7-sip-ear
test5-as7-sip-ejb
\__com.chema.ejb.PocheteEjbLocal$$$view6 TheEjb
\__com.chema.ejb.PocheteEjbLocal$$$view6
TheEjb!com.chema.ejb.PocheteEjbLocal
java:app/sip context:
test5
\__org.mobicents.servlet.sip.message.SipFactoryFacade SipFactory
\__org.mobicents.servlet.sip.core.session.SipSessionsUtilImpl
SipSessionsUtil
\__org.mobicents.servlet.sip.core.timers.TimerServiceImpl TimerService
12 years, 2 months
Preventing merge commits
by Jason T. Greene
If you want to prevent merge commits from ever entering a particular
branch of yours, say master, just do this:
git config branch.master.mergeoptions --ff-only
--
Jason T. Greene
JBoss AS Lead / EAP Platform Architect
JBoss, a division of Red Hat
12 years, 2 months
Does work @WebService with @Interceptor on AS 7.1.1.Final ?
by Marcelo Zabalet
I'm trying to use interceptors in conjuntion with webservices on AS
7.1.1.Final as the example shows below. The interceptor intercepts well
until it is combined with @WebService. Is this supposed to work? Am I
missing something?
----Binding---
@InterceptorBinding
@Target({METHOD, TYPE})
@Retention(RUNTIME)
@Inherited
public @interface SomeInterceptorBinding { }
---Interceptor---
@SomeInterceptorBinding
@Interceptor
public class SomeInterceptor {
@AroundInvoke
public Object handle(InvocationContext ctx) throws Exception {
return ctx.proceed();
}
}
---WebService---
@SomeInterceptorBinding
@WebService
public class AWebService {
@WebMethod
public void someMethod() {
...
}
}
---beans.xml---
<?xml version="1.0" encoding="UTF-8"?>
<beans ...>
<interceptors>
<class>com.xyz.SomeInterceptor</class>
</interceptors>
</beans>
12 years, 3 months
JBossWeb does incorrect async timeout behavior?
by Bill Burke
Both JBoss Web and Jetty 8.1 seem to do the same thing:
If you have suspended an HTTP request using request.suspend(100) and the
timeout is reached, they both seem to retry the request rather than
throwing an error code.
The javadoc for AsyncContext says otherwise though:
In the event that an asynchronous operation has timed out, the container
must run through these steps:
Invoke, at their onTimeout method, all AsyncListener instances
registered with the ServletRequest on which the asynchronous operation
was initiated.
If none of the listeners called complete() or any of the dispatch()
methods, perform an error dispatch with a status code equal to
HttpServletResponse.SC_INTERNAL_SERVER_ERROR.
If no matching error page was found, or the error page did not call
complete() or any of the dispatch() methods, call complete().
--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com
12 years, 3 months
Jboss CORBA Server
by Swapnesh
Hi,
My application has an interface with a device using CORBA i.e their is a
predifined idl using which the Device sends notification messages, so i
have to implement a CORBA server to which the Device will act like a
client. I tested it using Sun-JDK ORB and it works OK,
But what i want to do is, as jboss has JacORB with it, to build it in
jboss. I am not sure on from where and how to start this.
If you have any example/documentation could you please point me to it, I am
trying to read what documentations are already available.
Please let me know if my question is not clear :).
Thank you for your time.
12 years, 3 months
Naming Alias on Jboss 7
by Anderson vasconcelos
Hi there
I'm trying to migrate some .ear application to Jboss 7. The application
contain a xxx-service.xml where contains a lot of definitions of MBeans
that uses a org.jboss.naming.NamingAlias. I see that NamingAlias was not
provided on Jboss 7. How i can do this migation?
Is there other way to create "Simbolic Links" for EJBs on Jboss 7.?
This is a kind of configuration in xxx-service.xml:
<mbean code="org.jboss.naming.NamingAlias"
name="jboss.mq:service=NamingAlias,fromName=bbbb/bbbb/bbbbb/RendererRequestManager">
<attribute
name="ToName">./aaaaa/aaaaa/aaaaa/RendererRequestManager</attribute>
<attribute
name="FromName">bbbb/bbbb/bbbbb/RendererRequestManager</attribute>
</mbean>
Thanks
12 years, 3 months
manual way to do logging?
by Bill Burke
I do not want to use the JBoss Logging annotation framework as I do not
want to have a hard dependency on JBoss Logging for my project.
Is there a manual API that I can use instead to build a message?
Something like:
String getMessage(long id, Object... params);
Can't seem to find anything at the moment.
--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com
12 years, 3 months