Yes this is possible but it is not how Fuseki was designed to operate so do so at your own risk.
You will need to pull in Fuseki as a dependency, via maven this would be the following:
<dependency>
<groupId>org.apache.jena</groupId>
<artifactId>jena-fuseki</artifactId>
<version>0.2.7</version>
</dependency>
Then you can use the SPARQLServer
class to create a server and call start()
to actually run the server and stop()
when you are done. (This is located in the org.apache.jena.fuseki.server
package)
It is important to note that if you do this the server is embedded in the JVM from which you start it, when that JVM shuts down the server shuts down. This may be your intention but it may not.
Btw you question is unclear as to exactly why you want to do this? There may be alternative ways to achieve your goal without embedding Fuseki if you explain your goals further