Asynchronously Creating a Secure DOFSystem

Earlier we synchronously created a secure DOFSystem. Here we asynchronously create a secure DOFSystem and attach a DOFSystem.StateListener so we will be notified when the system is authorized.

How It Works

In cases when you do not want to block a thread while creating a DOFSystem, you can use the DOF.createSystem method that doesn't include a timeout parameter. In this case, the method returns a DOFSystem immediately. Keep in mind that the system may not be authorized yet (DOFCredentials on the DOFSystem are not verified). You can detect when a DOFSystem was authorized by adding a DOFSystem.StateListener implementation.