Thanks for your comments. The intent of using option #2 was to make use of getAttribute and also since modifying the KeystoreManager interface will not have any effect on any existing functionalities. However as you pointed out a get method w/o any return types may be misleading.
I don't know much about the details of the problem but it seems to me that you would either make the class serializable (option #1) or exclude it from serialization if it is not necessary. I don't see how this would impact any existing functions. So I guess I would vote for #1.
I don't understand why you would want to have a "get*" method that doesn't return anything - but perhaps I'm missing the point of option #2.
Ashish Jain wrote:
I have opened up a JIRA GERONIMO-5180 on the unlockKeystore command failure if keystore is created with keytool.exe. I was trying to fix this issue
which requires some changes in the class declaration or interface. Following code is being utilized to fix up the issue
KeystoreInstance keystores=(KeystoreInstance)kernel.getAttribute(abstractName,"keystores"); where abstractName is obtained through
"org.apache.geronimo.management.geronimo.KeystoreManager". However I hit the following exception:
java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
java.io.WriteAbortedException: writing aborted; java.io.NotSerializableE
at com.sun.jmx.remote.internal.PRef.invoke(Unknown Source)
There are 2 ways to fix this up.
1) Make the class org.apache.geronimo.security.keystore.FileKeystoreInstance serializable.
2) add a new variable in FileKeystoreManager and add a new method in KeystoreManager which does not return anything and just gives a call
to getKeystores(). For example getKeystores1() as the new method in KeystoreManager and a new variable as keystores1.
I shall prefer #2 over #1 as it should not have any effect on existing functionalities.