You can although most likely, you will need to perform the binding and control through an MBean. JBoss has plenty of examples in the source related to the Naming Server, with classes implementing the javax.naming.spi.ObjectFactory. However, the use and invocation may not be that apparent.
Perhaps a simpler example is from the pool branch in JBoss source. This demonstrates an object pool, the MBean required to bind the object pool, and the invocation of the object factory to generate/retrieve and object from the pool.
Hope that helps.