spring - How to create a method in a Java class that is accesible from only one other class -


i wondering if had pattern me achieve following:

we have jpa entity called employee , on there setlinemanager method. have separate updatelinestructureservice, spring-managed service bean. want try , ensure setlinemanager method can called updatelinestructureservice , not directly other class.

is there way allow service access method without exposing other classes? aware give method package level access , put service in same package employee, not fit our package structure prefer not that. aware make method private , access through reflection in 1 place, not solution @ all.

any ideas?

you can inspect stacktrace (using throwable#getstacktrace()) , see if contains allowed method on specified position.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -