[Design of POJO Server] - Re: ManagementView refresh
by scott.stark@jboss.org
"charles.crouch(a)jboss.com" wrote : I've added a couple more methods to ProfileServiceUnitTestCase to try out the new ManagedComponent api.
|
| Let me know if I'm not using the API in the correct way, and if you have any comments on my inline comments below..
|
|
| | public void testListComponents () throws Exception
| | {
| | ManagementView mgtView = getManagementView();
| |
| | // maybe needs a ctor which takes type,subtype ?
| | ComponentType type = new ComponentType();
| | type.setType("DataSource");
| | type.setType("LocalTX");
| | Set<ManagedComponent> comps = mgtView.getComponentsForType(type);
| |
| | if (comps != null)
| | {
| | for (ManagedComponent comp : comps)
| | {
| | String name = comp.getName();
| | Map<String,ManagedProperty> props = comp.getProperties();
| | }
| | }
| | }
| |
Needs to use type.setSubtype("LocalTX"), and there is a ctor now. I just checked it in as well. We will need enums for the standard component types as well.
"charles.crouch(a)jboss.com" wrote :
| /**
| * test api usage only
| * @throws Exception
| */
| public void testRemoveComponent () throws Exception
| {
| String componentName = "defaultDS";
| ManagementView mgtView = getManagementView();
|
| ComponentType type = new ComponentType();
| type.setType("DataSource");
| type.setType("LocalTX");
| Set comps = mgtView.getComponentsForType(type);
|
| // maybe a mgtView.getComponentByNameAndType(type, componentName) would be helpful
| // i'm assuming componentName and type will be unique in a given profile.
|
| if (comps != null)
| {
| for (ManagedComponent comp : comps)
| {
| if (componentName.equals(comp.getName()))
| {
| ManagedDeployment deployment = comp.getDeployment();
| deployment.removeComponent(comp);
| break;
| }
| }
| }
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4007043#4007043
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4007043
17 years, 5 months
[Design of JBoss Portal] - How to Signout from MyFacesGenericportlet
by npkphilips
I'm trying to write my own userPortlet. It must be jsf portlet. I am registering users using usermodule and also store my specific registartion information i my Databese table. evrything works fine. i have only problems with logout. I have in my jsf managed bean:
public void logout(ActionEvent event){
| ExternalContext context = FacesContext.getCurrentInstance().getExternalContext();
| JBossActionResponse respone = (JBossActionResponse) context.getResponse();
| respone.signOut();
| }
and call it from jsf page:
<h:commandLink value="logout" actionListener="#{bean.logout}" ></h:commandLink>
response.signOut create errors.
registration process uses jsf validation and converters so i don't wont to convert portlet into normal portlet. How can i logout from jsf portlet? When and how can I acces actionResponse from jsf portlet.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4007009#4007009
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4007009
17 years, 5 months
[Design of POJO Server] - Re: JAXBDeployer
by jason.greene@jboss.com
"adrian(a)jboss.org" wrote : anonymous wrote :
| |
| | JBossXB uses the xml namespace to determine the class to unmarshal
| | as the wildcard. You don't have to tell it a fixed number of classes/packages upfront
| | on the JAXBContext.
| |
|
| Either way the mapping of namespace to classes has to be known before unmarshalling, the difference is that you can lazy load classes with JBossXB. If lazy discovery is important, we should get involved with the spec and get it added.
|
| anonymous wrote :
| | JAXB is simply not extensible to abitrary wildcards.
| |
| |
| | | <xsd:choice minOccurs="0" maxOccurs="unbounded">
| | | <xsd:element name="string" type="stringType" minOccurs="0"/>
| | | <xsd:element name="blah" type="blahType" minOccurs="0"/>
| | | <xsd:any namespace="##other" processContents="strict" minOccurs="0"/>
| | | </xsd:choice>
| | |
| | | @RootElement
| | | public class MyClass
| | | {
| | | // Known bindings
| | | @XmlElement(name="string" type=StringSomething.class)
| | | @XmlElement(name="blah" type=BlahSomething.class)
| | |
| | | // Wildcard
| | | @XmlAnyElement(I'll accept anything that implements the interface!)
| | | public void setSomethings(List<Something> somethings) {}
| | | }
| | |
|
| The issue with a mapping like this is that if there is any similarity between the types that could be present on a wildcard, then using schema subtyping is more appropriate.
|
| -Jason
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4006975#4006975
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4006975
17 years, 5 months
[Design of POJO Server] - Re: ManagementView refresh
by charles.crouch@jboss.com
I've added a couple more methods to ProfileServiceUnitTestCase to try out the new ManagedComponent api.
Let me know if I'm not using the API in the correct way, and if you have any comments on my inline comments below..
| public void testListComponents () throws Exception
| {
| ManagementView mgtView = getManagementView();
|
| // maybe needs a ctor which takes type,subtype ?
| ComponentType type = new ComponentType();
| type.setType("DataSource");
| type.setType("LocalTX");
| Set<ManagedComponent> comps = mgtView.getComponentsForType(type);
|
| if (comps != null)
| {
| for (ManagedComponent comp : comps)
| {
| String name = comp.getName();
| Map<String,ManagedProperty> props = comp.getProperties();
| }
| }
| }
|
| /**
| * test api usage only
| * @throws Exception
| */
| public void testRemoveComponent () throws Exception
| {
| String componentName = "defaultDS";
| ManagementView mgtView = getManagementView();
|
| ComponentType type = new ComponentType();
| type.setType("DataSource");
| type.setType("LocalTX");
| Set<ManagedComponent> comps = mgtView.getComponentsForType(type);
|
| // maybe a mgtView.getComponentByNameAndType(type, componentName) would be helpful
| // i'm assuming componentName and type will be unique in a given profile.
|
| if (comps != null)
| {
| for (ManagedComponent comp : comps)
| {
| if (componentName.equals(comp.getName()))
| {
| ManagedDeployment deployment = comp.getDeployment();
| deployment.removeComponent(comp);
| break;
| }
| }
| }
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4006972#4006972
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4006972
17 years, 5 months