[Remoting] - Re: Simple Socket Server (TEXT)?
by ron.sigalï¼ jboss.com
anonymous wrote : One other question that cam up was how and where do we close the socket ofter the socket client has been served and sent a result back?
I take it you are asking about closing the socket on the server side? You really shouldn't have to worry about it.
The default socket transport behavior is for each socket to be held by a worker thread, which, after processing an invocation, sits in a read() waiting for the next invocation. The default timeout is 60000 ms, after which the socket will be closed. You can change the timeout by adding a "timeout" attribute:
| <invoker transport="socket">
| <attribute name="timeout">5000</attribute>
|
By the way, "socketTimeout" is obsolete - it really should be removed from jboss-service.xml.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4061551#4061551
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4061551
18Â years, 9Â months
[JBoss Seam] - Re: Seam gen edit pages, update without press save button
by Delphi's Ghost
I've come across this problem before, and pretty much used the same solution to solve it.
When you move from your edit page to the view page after canceling your changes, the conversation object itself is re-used, and uses the same entity manager. The entity manager contains an instance of the object you were just editing, and therefore when it 'loads' it, it just uses the version it already has which is dirty.
Add the following to the bottom of your template :
| <h:outputText value="Entity Manager : #{enityManager}"/><br/>
| <h:outputText value="Conversation : #{conversation}"/>
|
You can see how the same instance is used from one page to the next.
So, I just always use explicit saveChanges() and cancelChanges() methods which either saves the changes, or refreshes the entity. Ending the conversation can be handled from the @End annotation, or within the pages.xml or the pageflow depending on the String returned from the method.
I don't use the entity home stuff, but it should work the same.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4061546#4061546
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4061546
18Â years, 9Â months
[JBoss Seam] - Instance.hasRole()...
by garypinkham
I added code into my Authenticator object which adds roles to the Identity object. I tried to use a restriction on a page for a certain role but none of my logins have access now. So I added a check in the Authenticator right after adding the role(s) and it still returns false for hasRole(). I even hard coded a the addRole("admin") and that returns false when calling hasRole("admin") too...
Here's a quick snap shot of the code.. Let me know if you need more artifacts.
| if (user.getAuthoritieses() != null) {
| for (Authorities role : user.getAuthoritieses()) {
| log.info("adding role: #0 to user: #1", role.getAuthority(), Identity.instance().getUsername());
| Identity.instance().addRole(role.getAuthority());
| }
| }
| Identity.instance().addRole("admin");
| log.info("has Role: #0", Identity.instance().hasRole("ROLE_RUN_LINK")?"Yes":"No");
| log.info("has Role2: #0", Identity.instance().hasRole("admin")?"Yes":"No");
|
Which reminds me.. The code Seam generates uses an @In for Identity in the Authenticator sample class. But all the Docs show Identity.instance(). Is there a preference?
Thanks!
Gary
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4061541#4061541
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4061541
18Â years, 9Â months
[Security & JAAS/JBoss] - I need help. Please guide to me !
by changemylife
Hi all!
I write GUI to client can enter:
username and
password.
After, a client login and logout by:
LoginContext loginContext = new LoginContext("userTest", loginForm);
| loginContext.login();
| .......
| loginContext.logout()
Then, if this client relogin. How I setup this client no need enter username and password again (Here, example: I want get two informations: username and password to paste GUI).
I configure login-config.xml inside conf folder:
| <application-policy name = "YCLINICSE2007">
| <authentication>
| <login-module code = "org.jboss.security.ClientLoginModule" flag = "required">
| <module-option name="multi-threaded">true</module-option>
| <!-- Any existing security context will be restored on logout -->
| <module-option name="restore-login-identity">true</module-option>
| </login-module>
| <login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule"
| flag = "required">
| <module-option name = "unauthenticatedIdentity">guest</module-option>
| <module-option name = "dsJndiName">java:/MySqlDS</module-option>
| <module-option name = "principalsQuery">SELECT PASSWORD FROM USER WHERE USERNAME=?</module-option>
| <module-option name = "rolesQuery">SELECT ROLENAME, 'Roles' FROM USER_IN_ROLE WHERE USERNAME=?</module-option>
| </login-module>
| </authentication>
| </application-policy>
And, on the client side, I have auth.conf:
userTest {
| //client.security.MyLoginModule required;
| org.jboss.security.ClientLoginModule required;
| };
And my jboss.xml:
| <jboss>
| <security-domain>YCLINICSE2007</security-domain>
| <!-- <security-domain>java:/jaas/YCLINICSE2007</security-domain> -->
| <enterprise-beans>
| <session>
| <ejb-name>ClientActionBean</ejb-name>
| <resource-ref>
| <res-ref-name>jdbc/MySqlDS</res-ref-name>
| <jndi-name>java:/MySqlDS</jndi-name>
| </resource-ref>
| </session>
| </enterprise-beans>
| </jboss>
Thanks! Have a good day !
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4061540#4061540
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4061540
18Â years, 9Â months