[Design of EJB 3.0] - Re: Which is the best place to write a test case for ejb3-te
by jaikiran
"ALRubinger" wrote : Looks like the purpose of these unit tests are to test the mock container itself; correct assumption?
|
Yes. Although, it wasn't my original intention to test the mock container. I was using the mock container to test the jndi binding of a bean when i happened to run into this issue.
"ALRubinger" wrote :
|
| So green light for a commit on that piece at least.
|
| Also:
|
| * System.out.println == Bad. org.jboss.logging.Logger == Good (for these purposes anyway, it's a standard here, don't ask why another logging framework).
|
|
I understand :) I have incorporated this review comment and committed the fix and the test cases. SVN Revision: 76848
"ALRubinger" wrote :
| Say the word and I'll assign you some of my recent backlog of issues for Proxy.
|
|
Sure. That way, i can keep myself busy in my spare time and also get to understand more about the codebase.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4169722#4169722
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4169722
17 years, 8 months
[Design of POJO Server] - Re: ProfileService equiv to ServiceBindingManager
by bstansberry@jboss.com
Carlo raised a good point that having all the bindings in a centralized bindings.xml file is clumsy. It should be possible to add basic bindings on the fly. To support this I'm adding two things:
1) ServiceBindingStore has additional methods to allow addition of a binding to all of the named sets it knows about:
| /**
| * Add a ServiceBinding to all binding sets in the store. For each binding
| * set, a new ServiceBinding is added whose serviceName and bindingName
| * properties match the passed binding. The new binding's hostName matches
| * the target set's {@link #getDefaultHostName(String) default host name}.
| * The new binding's port is derived by taking the port from the passed
| * binding and incrementing it by the target set's
| * {@link #getDefaultPortOffset(String) default port offset}.
| *
| * @param serviceName the JMX ObjectName of the service
| * @param serviceConfig the configuration to add
| *
| * @throws DuplicateServiceException thrown if a configuration for the
| * <serverName, serviceName> pair already exists.
| */
| void addServiceBinding(ServiceBinding binding)
| throws DuplicateServiceException;
|
| /**
| * Remove a service configuration from all binding sets in the store.
| *
| * @param serviceBinding the binding
| */
| void removeServiceBinding(ServiceBinding binding);
|
| /**
| * Remove a service configuration from all binding sets in the store.
| *
| * @param serviceBinding the binding
| */
| void removeServiceBinding(String serviceName, String bindingName);
|
| /**
| * Gets the offset from a base value that by default should be added to
| * port values for a given serverName.
| *
| * @param serverName the name of the binding set
| * @return the offset
| */
| int getDefaultPortOffset(String serverName);
|
| /**
| * Gets the default value to use as the host name for the given serverName.
| *
| * @param serverName the name of the binding set
| * @return the host name
| */
| String getDefaultHostName(String serverName);
|
| /**
| * Value of <code>InetAddress.getByHost({@link #getDefaultHostName(String) getDefaultHost(serverName)})</code>.
| *
| * @param serverName the name of the binding set
| * @return the host name
| */
| InetAddress getDefaultBindAddress(String serverName);
With that, a newly deployed service could easily enough register its bindings by including a bean whose purpose is to do that.
Having to include such a bean is clumsy though, A simpler mechanism is to have the ServiceBindingManager methods include overloaded versions that take a base port value. If there is no matching binding, the SBM then uses that base value and adds the above defaultPortOffset to calculate the binding port.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4169702#4169702
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4169702
17 years, 8 months
[Design the new POJO MicroContainer] - Unexpected canonicalization of string
by bstansberry@jboss.com
I'm seeing a case where a string value is being converted into a canonical form before being passed to my object's constructor. This behavior seems odd to me and wanted to point it out in case it's considered to be a bug.
My class has a constructor like this:
public ServiceBinding(String serviceName, String hostName, int port)
The xml declaration is as follows:
<bean class="org.jboss.bindings.ServiceBinding">
| <constructor>
| <parameter>jboss.remoting:service=JMXConnectorServer,protocol=rmi</parameter>
| <parameter>${jboss.bind.address}</parameter>
| <parameter>1090</parameter>
| </constructor>
| </bean>
What's odd here is when the constructor is invoked, the passed in serviceName is the canonicalized form jboss.remoting:protocol=rmi,service=JMXConnectorServer . So it seems that even though the type of the parameter is String, something is detecting that the value looks like an ObjectName and is canonicalizing it.
There's no constructor that takes an ObjectName, so it's not a case of confusion about the desired type.
This is causing problems because value-factory parameter parsing in ServiceMetaDataParser isn't doing the same thing. So a ServiceBindingManager lookup of the binding fails. I can work around that, but it seems odd to have to.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4169692#4169692
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4169692
17 years, 8 months